pumax_8c_source.html 494 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <title>PUMA: /Users/home/WC/puma/src/pumax.c Source File</title>
  6. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  7. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  8. <link href="navtree.css" rel="stylesheet" type="text/css"/>
  9. <script type="text/javascript" src="jquery.js"></script>
  10. <script type="text/javascript" src="resize.js"></script>
  11. <script type="text/javascript" src="navtree.js"></script>
  12. <script type="text/javascript">
  13. $(document).ready(initResizable);
  14. </script>
  15. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  16. <script type="text/javascript" src="search/search.js"></script>
  17. <script type="text/javascript">
  18. $(document).ready(function() { searchBox.OnSelectItem(0); });
  19. </script>
  20. </head>
  21. <body>
  22. <div id="top"><!-- do not remove this div! -->
  23. <div id="titlearea">
  24. <table cellspacing="0" cellpadding="0">
  25. <tbody>
  26. <tr style="height: 56px;">
  27. <td id="projectlogo"><img alt="Logo" src="puma103.jpg"/></td>
  28. <td style="padding-left: 0.5em;">
  29. <div id="projectname">PUMA
  30. &#160;<span id="projectnumber">219</span>
  31. </div>
  32. <div id="projectbrief">Portable University Model of the Atmosphere</div>
  33. </td>
  34. </tr>
  35. </tbody>
  36. </table>
  37. </div>
  38. <!-- Generated by Doxygen 1.7.5.1 -->
  39. <script type="text/javascript">
  40. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  41. </script>
  42. <div id="navrow1" class="tabs">
  43. <ul class="tablist">
  44. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  45. <li><a href="annotated.html"><span>Data&#160;Types&#160;List</span></a></li>
  46. <li class="current"><a href="files.html"><span>Files</span></a></li>
  47. <li>
  48. <div id="MSearchBox" class="MSearchBoxInactive">
  49. <span class="left">
  50. <img id="MSearchSelect" src="search/mag_sel.png"
  51. onmouseover="return searchBox.OnSearchSelectShow()"
  52. onmouseout="return searchBox.OnSearchSelectHide()"
  53. alt=""/>
  54. <input type="text" id="MSearchField" value="Search" accesskey="S"
  55. onfocus="searchBox.OnSearchFieldFocus(true)"
  56. onblur="searchBox.OnSearchFieldFocus(false)"
  57. onkeyup="searchBox.OnSearchFieldChange(event)"/>
  58. </span><span class="right">
  59. <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
  60. </span>
  61. </div>
  62. </li>
  63. </ul>
  64. </div>
  65. <div id="navrow2" class="tabs2">
  66. <ul class="tablist">
  67. <li><a href="files.html"><span>File&#160;List</span></a></li>
  68. <li><a href="globals.html"><span>File&#160;Members</span></a></li>
  69. </ul>
  70. </div>
  71. </div>
  72. <div id="side-nav" class="ui-resizable side-nav-resizable">
  73. <div id="nav-tree">
  74. <div id="nav-tree-contents">
  75. </div>
  76. </div>
  77. <div id="splitbar" style="-moz-user-select:none;"
  78. class="ui-resizable-handle">
  79. </div>
  80. </div>
  81. <script type="text/javascript">
  82. initNavTree('pumax_8c.html','');
  83. </script>
  84. <div id="doc-content">
  85. <div class="header">
  86. <div class="headertitle">
  87. <div class="title">/Users/home/WC/puma/src/pumax.c</div> </div>
  88. </div>
  89. <div class="contents">
  90. <a href="pumax_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
  91. <a name="l00002"></a>00002 <span class="comment"> pumax - a GUI for PUMA &amp; PLASIM</span>
  92. <a name="l00003"></a>00003 <span class="comment"> (c) 2007 Edilbert Kirk (E.Kirk@gmx.de)</span>
  93. <a name="l00004"></a>00004 <span class="comment"></span>
  94. <a name="l00005"></a>00005 <span class="comment"> This program is free software; you can redistribute it and/or modify</span>
  95. <a name="l00006"></a>00006 <span class="comment"> it under the terms of the GNU General Public License as published by</span>
  96. <a name="l00007"></a>00007 <span class="comment"> the Free Software Foundation; either version 2 of the License, or</span>
  97. <a name="l00008"></a>00008 <span class="comment"> (at your option) any later version.</span>
  98. <a name="l00009"></a>00009 <span class="comment"></span>
  99. <a name="l00010"></a>00010 <span class="comment"> This program is distributed in the hope that it will be useful,</span>
  100. <a name="l00011"></a>00011 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
  101. <a name="l00012"></a>00012 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
  102. <a name="l00013"></a>00013 <span class="comment"> GNU General Public License for more details.</span>
  103. <a name="l00014"></a>00014 <span class="comment"></span>
  104. <a name="l00015"></a>00015 <span class="comment"> You should have received a copy of the GNU General Public License</span>
  105. <a name="l00016"></a>00016 <span class="comment"> along with this program; if not, write to the Free Software</span>
  106. <a name="l00017"></a>00017 <span class="comment"> Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span>
  107. <a name="l00018"></a>00018 <span class="comment">*/</span>
  108. <a name="l00019"></a>00019
  109. <a name="l00020"></a><a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">00020</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">Debug</a> = 0; <span class="comment">// set in initgui</span>
  110. <a name="l00021"></a>00021
  111. <a name="l00022"></a>00022 <span class="preprocessor">#include &lt;ctype.h&gt;</span>
  112. <a name="l00023"></a>00023 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
  113. <a name="l00024"></a>00024 <span class="preprocessor">#include &lt;string.h&gt;</span>
  114. <a name="l00025"></a>00025 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
  115. <a name="l00026"></a>00026 <span class="preprocessor">#include &lt;math.h&gt;</span>
  116. <a name="l00027"></a>00027 <span class="preprocessor">#include &lt;sys/time.h&gt;</span>
  117. <a name="l00028"></a>00028 <span class="preprocessor">#include &lt;sys/resource.h&gt;</span>
  118. <a name="l00029"></a>00029 <span class="preprocessor">#include &lt;X11/Xlib.h&gt;</span>
  119. <a name="l00030"></a>00030 <span class="preprocessor">#include &lt;X11/Xutil.h&gt;</span>
  120. <a name="l00031"></a>00031 <span class="preprocessor">#include &lt;X11/Xos.h&gt;</span>
  121. <a name="l00032"></a>00032 <span class="preprocessor">#include &lt;X11/Xatom.h&gt;</span>
  122. <a name="l00033"></a>00033 <span class="preprocessor">#include &lt;X11/keysym.h&gt;</span>
  123. <a name="l00034"></a>00034
  124. <a name="l00035"></a><a class="code" href="pumax_8c.html#afeeffe52c8fd59db7c61cf8b02042dbf">00035</a> <span class="preprocessor">#define INT int</span>
  125. <a name="l00036"></a><a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">00036</a> <span class="preprocessor"></span><span class="preprocessor">#define REAL float</span>
  126. <a name="l00037"></a><a class="code" href="pumax_8c.html#af03d9314df919290b49b331146eab250">00037</a> <span class="preprocessor"></span><span class="preprocessor">#define INTXU unsigned int</span>
  127. <a name="l00038"></a><a class="code" href="pumax_8c.html#a83e35c70462fc81d9b622790c8661e8e">00038</a> <span class="preprocessor"></span><span class="preprocessor">#define INTXS int</span>
  128. <a name="l00039"></a>00039 <span class="preprocessor"></span>
  129. <a name="l00040"></a>00040 <span class="preprocessor">#ifndef MIN</span>
  130. <a name="l00041"></a><a class="code" href="pumax_8c.html#a3acffbd305ee72dcd4593c0d8af64a4f">00041</a> <span class="preprocessor"></span><span class="preprocessor">#define MIN(a,b) ((a) &lt; (b) ? (a) : (b))</span>
  131. <a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
  132. <a name="l00043"></a>00043 <span class="preprocessor"></span>
  133. <a name="l00044"></a>00044 <span class="preprocessor">#ifndef MAX</span>
  134. <a name="l00045"></a><a class="code" href="pumax_8c.html#afa99ec4acc4ecb2dc3c2d05da15d0e3f">00045</a> <span class="preprocessor"></span><span class="preprocessor">#define MAX(a,b) ((a) &gt; (b) ? (a) : (b))</span>
  135. <a name="l00046"></a>00046 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
  136. <a name="l00047"></a>00047 <span class="preprocessor"></span>
  137. <a name="l00048"></a><a class="code" href="pumax_8c.html#ae880d2ccffb14a9a68b859d09f22e12a">00048</a> <span class="preprocessor">#define ROTATE_LEFT (XK_Left)</span>
  138. <a name="l00049"></a><a class="code" href="pumax_8c.html#a03653d3bb216e366e5f0144e79554a39">00049</a> <span class="preprocessor"></span><span class="preprocessor">#define ROTATE_RIGHT (XK_Right)</span>
  139. <a name="l00050"></a>00050 <span class="preprocessor"></span>
  140. <a name="l00051"></a><a class="code" href="pumax_8c.html#a5290d0773637802c437cf688938b1fe9">00051</a> <span class="preprocessor">#define TOLELO 0x0001</span>
  141. <a name="l00052"></a><a class="code" href="pumax_8c.html#a23aceec46faeb7e48b2883afca874b02">00052</a> <span class="preprocessor"></span><span class="preprocessor">#define TOLEHI 0x0002</span>
  142. <a name="l00053"></a><a class="code" href="pumax_8c.html#a89053abaa38cd43b0dbdbf70f6f644bd">00053</a> <span class="preprocessor"></span><span class="preprocessor">#define TORILO 0x0004</span>
  143. <a name="l00054"></a><a class="code" href="pumax_8c.html#a00b399ecbf8e7ce66fc45ae97d0ef149">00054</a> <span class="preprocessor"></span><span class="preprocessor">#define TORIHI 0x0008</span>
  144. <a name="l00055"></a><a class="code" href="pumax_8c.html#a26b56bf73405ae78f65554674d5bee88">00055</a> <span class="preprocessor"></span><span class="preprocessor">#define BOLELO 0x0010</span>
  145. <a name="l00056"></a><a class="code" href="pumax_8c.html#aec2de7a30131a34fd4a1475ef8120fc3">00056</a> <span class="preprocessor"></span><span class="preprocessor">#define BOLEHI 0x0020</span>
  146. <a name="l00057"></a><a class="code" href="pumax_8c.html#ac392454edf5f88606de52c510958b37b">00057</a> <span class="preprocessor"></span><span class="preprocessor">#define BORILO 0x0040</span>
  147. <a name="l00058"></a><a class="code" href="pumax_8c.html#ad2487d10128a4605d2c520818e714817">00058</a> <span class="preprocessor"></span><span class="preprocessor">#define BORIHI 0x0080</span>
  148. <a name="l00059"></a><a class="code" href="pumax_8c.html#a5f7b96511475eae60c0ec799497cd90d">00059</a> <span class="preprocessor"></span><span class="preprocessor">#define TOLEIN 0x0100</span>
  149. <a name="l00060"></a><a class="code" href="pumax_8c.html#ab9fb8c5f3129d06df9e3d04b46f331c4">00060</a> <span class="preprocessor"></span><span class="preprocessor">#define TOREIN 0x0200</span>
  150. <a name="l00061"></a><a class="code" href="pumax_8c.html#a4813a896f0863ba6435dc000ef2148d1">00061</a> <span class="preprocessor"></span><span class="preprocessor">#define BOLEIN 0x0400</span>
  151. <a name="l00062"></a><a class="code" href="pumax_8c.html#a77808b38279936748a451a902ec442a4">00062</a> <span class="preprocessor"></span><span class="preprocessor">#define BOREIN 0x0800</span>
  152. <a name="l00063"></a>00063 <span class="preprocessor"></span>
  153. <a name="l00064"></a><a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">00064</a> <span class="preprocessor">#define IPX(l,m,h) (VGAX * (x + (l-m) / (l-h)))</span>
  154. <a name="l00065"></a><a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">00065</a> <span class="preprocessor"></span><span class="preprocessor">#define IPY(l,m,h) (VGAY * (y + (l-m) / (l-h)))</span>
  155. <a name="l00066"></a>00066 <span class="preprocessor"></span>
  156. <a name="l00067"></a><a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">00067</a> <span class="preprocessor">#define NUMWIN 9</span>
  157. <a name="l00068"></a><a class="code" href="pumax_8c.html#afa68e13002f97f4041b7acca426be273">00068</a> <span class="preprocessor"></span><span class="preprocessor">#define NUMPAL 13</span>
  158. <a name="l00069"></a>00069 <span class="preprocessor"></span>
  159. <a name="l00070"></a>00070 <span class="comment">/* Picture types */</span>
  160. <a name="l00071"></a>00071
  161. <a name="l00072"></a><a class="code" href="pumax_8c.html#a2f1d89ef346ef5189b556085f4553c4c">00072</a> <span class="preprocessor">#define ISOHOR 0</span>
  162. <a name="l00073"></a><a class="code" href="pumax_8c.html#afc9e7bd37f3dc38ff12cdf5edb85a6d2">00073</a> <span class="preprocessor"></span><span class="preprocessor">#define ISOCS 1</span>
  163. <a name="l00074"></a><a class="code" href="pumax_8c.html#a5cacfe29b73c60abfa48f1ab23b8d631">00074</a> <span class="preprocessor"></span><span class="preprocessor">#define ISOHOV 2</span>
  164. <a name="l00075"></a><a class="code" href="pumax_8c.html#ad93abacbefeab6ede34e9110ebce9769">00075</a> <span class="preprocessor"></span><span class="preprocessor">#define ISOTS 3</span>
  165. <a name="l00076"></a><a class="code" href="pumax_8c.html#aa817497929617f9ee37a0e957c9e21e1">00076</a> <span class="preprocessor"></span><span class="preprocessor">#define ISOTAB 4</span>
  166. <a name="l00077"></a><a class="code" href="pumax_8c.html#ae41274f4b33dfd046884def7709aa887">00077</a> <span class="preprocessor"></span><span class="preprocessor">#define ISOSH 5</span>
  167. <a name="l00078"></a><a class="code" href="pumax_8c.html#ad3652a10b82037800a3efb555fb7833c">00078</a> <span class="preprocessor"></span><span class="preprocessor">#define ISOLON 6</span>
  168. <a name="l00079"></a><a class="code" href="pumax_8c.html#a4c30d0a50533694deda0fcf3551b6935">00079</a> <span class="preprocessor"></span><span class="preprocessor">#define ISOTRA 7</span>
  169. <a name="l00080"></a><a class="code" href="pumax_8c.html#a35e0c3caf44835d5c02d3af3b975e21b">00080</a> <span class="preprocessor"></span><span class="preprocessor">#define ISOCOL 8</span>
  170. <a name="l00081"></a><a class="code" href="pumax_8c.html#aa432935ef1f77c464765c0e3106ad340">00081</a> <span class="preprocessor"></span><span class="preprocessor">#define ISOROT 9</span>
  171. <a name="l00082"></a><a class="code" href="pumax_8c.html#a3e3bcad4c273544328bcdcaef35c3852">00082</a> <span class="preprocessor"></span><span class="preprocessor">#define MAPHOR 10</span>
  172. <a name="l00083"></a><a class="code" href="pumax_8c.html#a1572b520f538d357372e96d0185275e5">00083</a> <span class="preprocessor"></span><span class="preprocessor">#define MAPTRA 11</span>
  173. <a name="l00084"></a>00084 <span class="preprocessor"></span>
  174. <a name="l00085"></a>00085 <span class="comment">/* Models */</span>
  175. <a name="l00086"></a>00086
  176. <a name="l00087"></a><a class="code" href="pumax_8c.html#a7c5db3163704e174dd734f55fdc698e9">00087</a> <span class="preprocessor">#define PUMA 0</span>
  177. <a name="l00088"></a>00088 <span class="preprocessor"></span>
  178. <a name="l00089"></a><a class="code" href="pumax_8c.html#a521281f5e10ed8f5e4cdb50ead3b2612">00089</a> <span class="keywordtype">char</span> *<a class="code" href="pumax_8c.html#a521281f5e10ed8f5e4cdb50ead3b2612">IsoNames</a>[] =
  179. <a name="l00090"></a>00090 {
  180. <a name="l00091"></a>00091 <span class="stringliteral">&quot;ISOHOR&quot;</span>,
  181. <a name="l00092"></a>00092 <span class="stringliteral">&quot;ISOCS&quot;</span>,
  182. <a name="l00093"></a>00093 <span class="stringliteral">&quot;ISOHOV&quot;</span>,
  183. <a name="l00094"></a>00094 <span class="stringliteral">&quot;ISOTS&quot;</span>,
  184. <a name="l00095"></a>00095 <span class="stringliteral">&quot;ISOTAB&quot;</span>,
  185. <a name="l00096"></a>00096 <span class="stringliteral">&quot;ISOSH&quot;</span>,
  186. <a name="l00097"></a>00097 <span class="stringliteral">&quot;ISOLON&quot;</span>,
  187. <a name="l00098"></a>00098 <span class="stringliteral">&quot;ISOTRA&quot;</span>,
  188. <a name="l00099"></a>00099 <span class="stringliteral">&quot;ISOCOL&quot;</span>,
  189. <a name="l00100"></a>00100 <span class="stringliteral">&quot;ISOROT&quot;</span>,
  190. <a name="l00101"></a>00101 <span class="stringliteral">&quot;MAPHOR&quot;</span>,
  191. <a name="l00102"></a>00102 <span class="stringliteral">&quot;MAPTRA&quot;</span>
  192. <a name="l00103"></a>00103 };
  193. <a name="l00104"></a>00104
  194. <a name="l00105"></a><a class="code" href="pumax_8c.html#a834a993015b3b6e5f609501c9ada9ce7">00105</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a834a993015b3b6e5f609501c9ada9ce7">IsoTypes</a> = <span class="keyword">sizeof</span>(<a class="code" href="pumax_8c.html#a521281f5e10ed8f5e4cdb50ead3b2612">IsoNames</a>) / <span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *);
  195. <a name="l00106"></a>00106
  196. <a name="l00107"></a><a class="code" href="pumax_8c.html#a37a21fafd45eeb427d40623be31f13c5">00107</a> <span class="keywordtype">char</span> *<a class="code" href="pumax_8c.html#a37a21fafd45eeb427d40623be31f13c5">PalNames</a>[] =
  197. <a name="l00108"></a>00108 {
  198. <a name="l00109"></a>00109 <span class="stringliteral">&quot;AUTO&quot;</span>,
  199. <a name="l00110"></a>00110 <span class="stringliteral">&quot;U&quot;</span>,
  200. <a name="l00111"></a>00111 <span class="stringliteral">&quot;V&quot;</span>,
  201. <a name="l00112"></a>00112 <span class="stringliteral">&quot;T&quot;</span>,
  202. <a name="l00113"></a>00113 <span class="stringliteral">&quot;P&quot;</span>,
  203. <a name="l00114"></a>00114 <span class="stringliteral">&quot;Q&quot;</span>,
  204. <a name="l00115"></a>00115 <span class="stringliteral">&quot;MARST&quot;</span>,
  205. <a name="l00116"></a>00116 <span class="stringliteral">&quot;AMPLI&quot;</span>,
  206. <a name="l00117"></a>00117 <span class="stringliteral">&quot;VEG&quot;</span>,
  207. <a name="l00118"></a>00118 <span class="stringliteral">&quot;OCET&quot;</span>,
  208. <a name="l00119"></a>00119 <span class="stringliteral">&quot;OCES&quot;</span>,
  209. <a name="l00120"></a>00120 <span class="stringliteral">&quot;DCC&quot;</span>,
  210. <a name="l00121"></a>00121 <span class="stringliteral">&quot;DTDT&quot;</span>
  211. <a name="l00122"></a>00122 };
  212. <a name="l00123"></a>00123
  213. <a name="l00124"></a><a class="code" href="pumax_8c.html#a51158475dcc6ea9c026070a471573cf9">00124</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a51158475dcc6ea9c026070a471573cf9">PalTypes</a> = <span class="keyword">sizeof</span>(<a class="code" href="pumax_8c.html#a37a21fafd45eeb427d40623be31f13c5">PalNames</a>) / <span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *);
  214. <a name="l00125"></a>00125
  215. <a name="l00126"></a>00126 <span class="comment">/* Map projections */</span>
  216. <a name="l00127"></a>00127
  217. <a name="l00128"></a><a class="code" href="pumax_8c.html#afc5baef270da4d092b8e86c03bf949ad">00128</a> <span class="preprocessor">#define CYLINDRICAL 0</span>
  218. <a name="l00129"></a><a class="code" href="pumax_8c.html#ad431eb8cf00095009fcd1924efffa213">00129</a> <span class="preprocessor"></span><span class="preprocessor">#define POLAR 1</span>
  219. <a name="l00130"></a><a class="code" href="pumax_8c.html#aae4090be0e30c18b0f22650479767d8f">00130</a> <span class="preprocessor"></span><span class="preprocessor">#define AZIMUTHAL 2</span>
  220. <a name="l00131"></a>00131 <span class="preprocessor"></span>
  221. <a name="l00132"></a><a class="code" href="pumax_8c.html#a3b66883efb152a59e42802d74245ae5a">00132</a> <span class="preprocessor">#define MAXMAPS 3</span>
  222. <a name="l00133"></a>00133 <span class="preprocessor"></span>
  223. <a name="l00134"></a><a class="code" href="pumax_8c.html#a5659144282d3965ba43ddb5cf0855b06">00134</a> <span class="keywordtype">char</span> *<a class="code" href="pumax_8c.html#a5659144282d3965ba43ddb5cf0855b06">ProNames</a>[] =
  224. <a name="l00135"></a>00135 {
  225. <a name="l00136"></a>00136 <span class="stringliteral">&quot;CYLINDRICAL&quot;</span>,
  226. <a name="l00137"></a>00137 <span class="stringliteral">&quot;POLAR&quot;</span>,
  227. <a name="l00138"></a>00138 <span class="stringliteral">&quot;AZIMUTHAL&quot;</span>
  228. <a name="l00139"></a>00139 };
  229. <a name="l00140"></a>00140
  230. <a name="l00141"></a>00141
  231. <a name="l00142"></a>00142 <span class="comment">/* Coordinates of button areas */</span>
  232. <a name="l00143"></a>00143
  233. <a name="l00144"></a><a class="code" href="pumax_8c.html#a55bccb7615db7906d83dfde784e900ca">00144</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a55bccb7615db7906d83dfde784e900ca">ShowQueue</a> = 0;
  234. <a name="l00145"></a><a class="code" href="pumax_8c.html#a30026665e31656bee8b8742fa67aca6e">00145</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a30026665e31656bee8b8742fa67aca6e">ShowOnce</a> = 1;
  235. <a name="l00146"></a><a class="code" href="pumax_8c.html#af92a559968f024eaf3b09e93db8c4ac3">00146</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#af92a559968f024eaf3b09e93db8c4ac3">OffsetY</a> = 20;
  236. <a name="l00147"></a>00147
  237. <a name="l00148"></a><a class="code" href="pumax_8c.html#ad24990368c579bb1864cbc8c3ce3e721">00148</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ad24990368c579bb1864cbc8c3ce3e721">Stop_XL</a>;
  238. <a name="l00149"></a><a class="code" href="pumax_8c.html#a4b06c4dca623e48a89ca4cd41a78629e">00149</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a4b06c4dca623e48a89ca4cd41a78629e">Stop_XH</a>;
  239. <a name="l00150"></a><a class="code" href="pumax_8c.html#a91b3c0f8c4770ad36e64106a0aebc691">00150</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a91b3c0f8c4770ad36e64106a0aebc691">Stop_YL</a>;
  240. <a name="l00151"></a><a class="code" href="pumax_8c.html#a8e6314067e8a239ee1389b87e06d60d6">00151</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a8e6314067e8a239ee1389b87e06d60d6">Stop_YH</a>;
  241. <a name="l00152"></a>00152
  242. <a name="l00153"></a><a class="code" href="pumax_8c.html#a88857d63fe1d8cbdfee28fd0839416d0">00153</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a88857d63fe1d8cbdfee28fd0839416d0">Start_XL</a>;
  243. <a name="l00154"></a><a class="code" href="pumax_8c.html#a8a1c7807764e545cae05ec82d33db998">00154</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a8a1c7807764e545cae05ec82d33db998">Start_XH</a>;
  244. <a name="l00155"></a><a class="code" href="pumax_8c.html#aa6b7da43e548f98c9c0a1aa042955e53">00155</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#aa6b7da43e548f98c9c0a1aa042955e53">Start_YL</a>;
  245. <a name="l00156"></a><a class="code" href="pumax_8c.html#ad7f26c40f9aa636fc053415fa4a49649">00156</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ad7f26c40f9aa636fc053415fa4a49649">Start_YH</a>;
  246. <a name="l00157"></a>00157
  247. <a name="l00158"></a><a class="code" href="pumax_8c.html#aa5937b1ae55303df3b9e9d865aef1411">00158</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#aa5937b1ae55303df3b9e9d865aef1411">Pause_XL</a>;
  248. <a name="l00159"></a><a class="code" href="pumax_8c.html#a941d0cebf5d93486d5c5c4ee7adccb13">00159</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a941d0cebf5d93486d5c5c4ee7adccb13">Pause_XH</a>;
  249. <a name="l00160"></a><a class="code" href="pumax_8c.html#a62f16cafe798c067ab8a6effb26b21c2">00160</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a62f16cafe798c067ab8a6effb26b21c2">Pause_YL</a>;
  250. <a name="l00161"></a><a class="code" href="pumax_8c.html#a335dc1da623733cdc46be9818f7faeb5">00161</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a335dc1da623733cdc46be9818f7faeb5">Pause_YH</a>;
  251. <a name="l00162"></a>00162
  252. <a name="l00163"></a><a class="code" href="pumax_8c.html#a8bfeeb88bca700f71c0452ac7dbb6305">00163</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a8bfeeb88bca700f71c0452ac7dbb6305">Help_XL</a>;
  253. <a name="l00164"></a><a class="code" href="pumax_8c.html#aa5ac3fa76bbe5c45098ab00e18d7cf1c">00164</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#aa5ac3fa76bbe5c45098ab00e18d7cf1c">Help_XH</a>;
  254. <a name="l00165"></a><a class="code" href="pumax_8c.html#a3ce4455dd3233998629c417853f31360">00165</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a3ce4455dd3233998629c417853f31360">Help_YL</a>;
  255. <a name="l00166"></a><a class="code" href="pumax_8c.html#a2bbd0d368ae6db480004cff4af321f0a">00166</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a2bbd0d368ae6db480004cff4af321f0a">Help_YH</a>;
  256. <a name="l00167"></a>00167
  257. <a name="l00168"></a><a class="code" href="pumax_8c.html#ab832698174a27897c4f45e1ed274fb77">00168</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ab832698174a27897c4f45e1ed274fb77">Minus_XL</a>;
  258. <a name="l00169"></a><a class="code" href="pumax_8c.html#afc5898a8a6b1361c5bca44e01339565b">00169</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#afc5898a8a6b1361c5bca44e01339565b">Minus_XH</a>;
  259. <a name="l00170"></a><a class="code" href="pumax_8c.html#a8eed85ad2425df37d1a278571e0e2268">00170</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a8eed85ad2425df37d1a278571e0e2268">Minus_YL</a>;
  260. <a name="l00171"></a><a class="code" href="pumax_8c.html#a9f064372aac5b9c6646ae41c1366dd67">00171</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a9f064372aac5b9c6646ae41c1366dd67">Minus_YH</a>;
  261. <a name="l00172"></a>00172
  262. <a name="l00173"></a><a class="code" href="pumax_8c.html#a7ba7f7c48b83e9dd7786f1430b118aaa">00173</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a7ba7f7c48b83e9dd7786f1430b118aaa">FBWD_XL</a>;
  263. <a name="l00174"></a><a class="code" href="pumax_8c.html#a2a4481c974f1e07e30e458c860d1148c">00174</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a2a4481c974f1e07e30e458c860d1148c">FBWD_XH</a>;
  264. <a name="l00175"></a><a class="code" href="pumax_8c.html#a202a87cbecd2d4b3d862aa705eae5537">00175</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a202a87cbecd2d4b3d862aa705eae5537">FBWD_YL</a>;
  265. <a name="l00176"></a><a class="code" href="pumax_8c.html#a96b9387b1bc2c8556579b7d4ef5fdb29">00176</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a96b9387b1bc2c8556579b7d4ef5fdb29">FBWD_YH</a>;
  266. <a name="l00177"></a>00177
  267. <a name="l00178"></a><a class="code" href="pumax_8c.html#ad4a5ddea9738fe7d909456d4a32fe428">00178</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ad4a5ddea9738fe7d909456d4a32fe428">Plus_XL</a>;
  268. <a name="l00179"></a><a class="code" href="pumax_8c.html#a14958f61e1a0ee0b8e89c94a4460e338">00179</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a14958f61e1a0ee0b8e89c94a4460e338">Plus_XH</a>;
  269. <a name="l00180"></a><a class="code" href="pumax_8c.html#ad45d3847d400c8c39d830bd219eee39f">00180</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ad45d3847d400c8c39d830bd219eee39f">Plus_YL</a>;
  270. <a name="l00181"></a><a class="code" href="pumax_8c.html#a6a42672cdcc2c6cca8c6d3670fecd7c3">00181</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a6a42672cdcc2c6cca8c6d3670fecd7c3">Plus_YH</a>;
  271. <a name="l00182"></a>00182
  272. <a name="l00183"></a><a class="code" href="pumax_8c.html#a493618c426beabf157dbbebef440412f">00183</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a493618c426beabf157dbbebef440412f">FFWD_XL</a>;
  273. <a name="l00184"></a><a class="code" href="pumax_8c.html#abce69811070050cf5376b801b3990d07">00184</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#abce69811070050cf5376b801b3990d07">FFWD_XH</a>;
  274. <a name="l00185"></a><a class="code" href="pumax_8c.html#acaf325c4292608bd8c889977fd15e154">00185</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#acaf325c4292608bd8c889977fd15e154">FFWD_YL</a>;
  275. <a name="l00186"></a><a class="code" href="pumax_8c.html#aa98699812a1c44b825154ce059b16901">00186</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#aa98699812a1c44b825154ce059b16901">FFWD_YH</a>;
  276. <a name="l00187"></a>00187
  277. <a name="l00188"></a><a class="code" href="pumax_8c.html#ae373f8d537ec4fe119fa2f056a1026b6">00188</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ae373f8d537ec4fe119fa2f056a1026b6">Parc_XL</a>;
  278. <a name="l00189"></a><a class="code" href="pumax_8c.html#a11016a2a4ce39e73044ca7b91c9b9834">00189</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a11016a2a4ce39e73044ca7b91c9b9834">Parc_XH</a>;
  279. <a name="l00190"></a><a class="code" href="pumax_8c.html#a66f79d4b0d0e901fc506292532e47140">00190</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a66f79d4b0d0e901fc506292532e47140">Parc_XD</a>;
  280. <a name="l00191"></a><a class="code" href="pumax_8c.html#ae13ffbf97704d055020c491c4e74ff0f">00191</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ae13ffbf97704d055020c491c4e74ff0f">Parc_YL</a>;
  281. <a name="l00192"></a><a class="code" href="pumax_8c.html#aa23d097ca998e5e55e701dc31d2739fc">00192</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#aa23d097ca998e5e55e701dc31d2739fc">Parc_YH</a>;
  282. <a name="l00193"></a><a class="code" href="pumax_8c.html#a6cfaf9b0896544285a021d496043517f">00193</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a6cfaf9b0896544285a021d496043517f">Parc_YD</a>;
  283. <a name="l00194"></a>00194
  284. <a name="l00195"></a><a class="code" href="pumax_8c.html#a34c9aca7c9d3e891e823db12a7521fe2">00195</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a34c9aca7c9d3e891e823db12a7521fe2">Wbox_XL</a>;
  285. <a name="l00196"></a><a class="code" href="pumax_8c.html#a91db002a6cd9e7b9151c2a55cbd816be">00196</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a91db002a6cd9e7b9151c2a55cbd816be">Wbox_XH</a>;
  286. <a name="l00197"></a><a class="code" href="pumax_8c.html#a7dd050c049730eaa17780c85db427571">00197</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a7dd050c049730eaa17780c85db427571">Wbox_YL</a>;
  287. <a name="l00198"></a><a class="code" href="pumax_8c.html#a28605df273e4c600abe43e5cba54c54d">00198</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a28605df273e4c600abe43e5cba54c54d">Wbox_YH</a>;
  288. <a name="l00199"></a>00199
  289. <a name="l00200"></a><a class="code" href="pumax_8c.html#adbf17b3e938de11e352f68acd0273ada">00200</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#adbf17b3e938de11e352f68acd0273ada">Grid_XL</a>;
  290. <a name="l00201"></a><a class="code" href="pumax_8c.html#ab72ce760d251cc0020a579cdb987c881">00201</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ab72ce760d251cc0020a579cdb987c881">Grid_XH</a>;
  291. <a name="l00202"></a><a class="code" href="pumax_8c.html#af60996257395d9ddc45200ad8dd9a4ae">00202</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#af60996257395d9ddc45200ad8dd9a4ae">Grid_YL</a>;
  292. <a name="l00203"></a><a class="code" href="pumax_8c.html#a350e09c829698cdbbf05b10551a82671">00203</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a350e09c829698cdbbf05b10551a82671">Grid_YH</a>;
  293. <a name="l00204"></a>00204
  294. <a name="l00205"></a><a class="code" href="pumax_8c.html#ab30678c46d43e623c90639d5e71d7d5c">00205</a> XPoint <a class="code" href="pumax_8c.html#ab30678c46d43e623c90639d5e71d7d5c">StopButton</a>[4] = {{10,10},{40,10},{40,40},{10,40}};
  295. <a name="l00206"></a><a class="code" href="pumax_8c.html#a96eeb7df5a5d181536249e70733371b8">00206</a> XPoint <a class="code" href="pumax_8c.html#a96eeb7df5a5d181536249e70733371b8">StartButton</a>[3] = {{50,10},{80,25},{50,40}};
  296. <a name="l00207"></a><a class="code" href="pumax_8c.html#ad98a1896b9076d6d94dd002922c2f0dc">00207</a> XPoint <a class="code" href="pumax_8c.html#ad98a1896b9076d6d94dd002922c2f0dc">PauseButton1</a>[4] = {{95,10},{102,10},{102,40},{95,40}};
  297. <a name="l00208"></a><a class="code" href="pumax_8c.html#a7bb723eb33c840844906c7b42c5bb99b">00208</a> XPoint <a class="code" href="pumax_8c.html#a7bb723eb33c840844906c7b42c5bb99b">PauseButton2</a>[4] = {{108,10},{115,10},{115,40},{108,40}};
  298. <a name="l00209"></a>00209
  299. <a name="l00210"></a><a class="code" href="pumax_8c.html#a90b6c7836a1eb1537db72ccc21295413">00210</a> <span class="preprocessor">#define PARCS 100</span>
  300. <a name="l00211"></a>00211 <span class="preprocessor"></span>
  301. <a name="l00212"></a><a class="code" href="struct_parc_struct.html">00212</a> <span class="keyword">struct </span><a class="code" href="struct_parc_struct.html">ParcStruct</a>
  302. <a name="l00213"></a>00213 {
  303. <a name="l00214"></a><a class="code" href="struct_parc_struct.html#ac9d04b9041919c070a322e95865dd52d">00214</a> <span class="keywordtype">char</span> <a class="code" href="struct_parc_struct.html#ac9d04b9041919c070a322e95865dd52d">Name</a>[8];
  304. <a name="l00215"></a><a class="code" href="struct_parc_struct.html#a8228d63eefa1fb42c060ab069bcf2a1b">00215</a> <span class="keywordtype">float</span> <a class="code" href="struct_parc_struct.html#a8228d63eefa1fb42c060ab069bcf2a1b">Inc</a>;
  305. <a name="l00216"></a><a class="code" href="struct_parc_struct.html#a2a2d6960e03fa37291f0fff4402f4a38">00216</a> <span class="keywordtype">float</span> <a class="code" href="struct_parc_struct.html#a2a2d6960e03fa37291f0fff4402f4a38">Min</a>;
  306. <a name="l00217"></a><a class="code" href="struct_parc_struct.html#a01b1f457258f82282fdeeb6d8d4fbd8b">00217</a> <span class="keywordtype">float</span> <a class="code" href="struct_parc_struct.html#a01b1f457258f82282fdeeb6d8d4fbd8b">Max</a>;
  307. <a name="l00218"></a><a class="code" href="struct_parc_struct.html#a4901f0bf816a2d336307e9e3fcc95d82">00218</a> <span class="keywordtype">float</span> <a class="code" href="struct_parc_struct.html#a4901f0bf816a2d336307e9e3fcc95d82">Val</a>;
  308. <a name="l00219"></a>00219 };
  309. <a name="l00220"></a>00220
  310. <a name="l00221"></a><a class="code" href="pumax_8c.html#a4444b7b37748213e596d8d51dfdb3315">00221</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a4444b7b37748213e596d8d51dfdb3315">Parcs</a>;
  311. <a name="l00222"></a><a class="code" href="pumax_8c.html#ae660f447290dcbe0903af3b8bbff9450">00222</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ae660f447290dcbe0903af3b8bbff9450">cpi</a> = 1;
  312. <a name="l00223"></a>00223
  313. <a name="l00224"></a><a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">00224</a> <span class="keyword">struct </span><a class="code" href="struct_parc_struct.html">ParcStruct</a> <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[<a class="code" href="pumax_8c.html#a90b6c7836a1eb1537db72ccc21295413">PARCS</a>];
  314. <a name="l00225"></a>00225
  315. <a name="l00226"></a><a class="code" href="pumax_8c.html#a80a50b0eff10ca625769bac2a9e15cd3">00226</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a80a50b0eff10ca625769bac2a9e15cd3">screen_num</a>;
  316. <a name="l00227"></a>00227
  317. <a name="l00228"></a><a class="code" href="pumax_8c.html#a854f9eb314f72feecf68ba03c6f0e5d5">00228</a> Display *<a class="code" href="pumax_8c.html#a854f9eb314f72feecf68ba03c6f0e5d5">display</a>;
  318. <a name="l00229"></a><a class="code" href="pumax_8c.html#a47745e91e472dc647c023d88e004f6be">00229</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a47745e91e472dc647c023d88e004f6be">ScreenW</a>,<a class="code" href="pumax_8c.html#a8b8a3a3a0640d58f940680ffabe74433">ScreenH</a>,<a class="code" href="pumax_8c.html#a2c52cfcbe626779731c3bb7bac1a6c43">ScreenBot</a>;
  319. <a name="l00230"></a><a class="code" href="pumax_8c.html#acac7568f426c5e9b9041b9270c252a6f">00230</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#acac7568f426c5e9b9041b9270c252a6f">SmallScreen</a>;
  320. <a name="l00231"></a>00231
  321. <a name="l00232"></a>00232 <span class="keyword">static</span> <span class="keywordtype">char</span> *progname = <span class="stringliteral">&quot;PUMA&quot;</span>;
  322. <a name="l00233"></a>00233
  323. <a name="l00234"></a><a class="code" href="pumax_8c.html#aee7525a437c583a9446fd55457f26003">00234</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#aee7525a437c583a9446fd55457f26003">BigEndian</a>;
  324. <a name="l00235"></a><a class="code" href="pumax_8c.html#a59713e313b4ee9b7937c09d8aeb88994">00235</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a59713e313b4ee9b7937c09d8aeb88994">ScreenOffset</a>;
  325. <a name="l00236"></a><a class="code" href="pumax_8c.html#af78e6c4aa716185050920dee4e224cb0">00236</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#af78e6c4aa716185050920dee4e224cb0">Model</a>;
  326. <a name="l00237"></a><a class="code" href="pumax_8c.html#ae150d767abfed25f0cb775bc4835c270">00237</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ae150d767abfed25f0cb775bc4835c270">CowX</a> = -1;
  327. <a name="l00238"></a><a class="code" href="pumax_8c.html#a3a22a7d3a3f9708bacfd622911f3d77a">00238</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a3a22a7d3a3f9708bacfd622911f3d77a">CowY</a> = -1;
  328. <a name="l00239"></a><a class="code" href="pumax_8c.html#a4c0dc1ddfa49f758e626fbe8e5e2259e">00239</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a4c0dc1ddfa49f758e626fbe8e5e2259e">CowW</a>;
  329. <a name="l00240"></a><a class="code" href="pumax_8c.html#a5d560d88e396adf0394249a56c20155a">00240</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a5d560d88e396adf0394249a56c20155a">CowH</a>;
  330. <a name="l00241"></a><a class="code" href="pumax_8c.html#a2364498cd60ebd2201eeef32ce76e882">00241</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a2364498cd60ebd2201eeef32ce76e882">NumWin</a> = <a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>;
  331. <a name="l00242"></a><a class="code" href="pumax_8c.html#ab861bd4dcef3d655198c4eb74dea5eb7">00242</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ab861bd4dcef3d655198c4eb74dea5eb7">WinCols</a> = 3;
  332. <a name="l00243"></a><a class="code" href="pumax_8c.html#ab109c22b7def164d1136cb9ceb9f6819">00243</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ab109c22b7def164d1136cb9ceb9f6819">WinRows</a> = 3;
  333. <a name="l00244"></a><a class="code" href="pumax_8c.html#ad690a03cd8fa2b253d17c3b93e6ad279">00244</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ad690a03cd8fa2b253d17c3b93e6ad279">DimT</a> = 100; <span class="comment">// Default length of time axis</span>
  334. <a name="l00245"></a><a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">00245</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>;
  335. <a name="l00246"></a><a class="code" href="pumax_8c.html#ace2f02cb6559cc7f528a995935d30878">00246</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ace2f02cb6559cc7f528a995935d30878">DimY</a>;
  336. <a name="l00247"></a><a class="code" href="pumax_8c.html#a510628f6a0e0c51b4ca6492e4d8595e0">00247</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a510628f6a0e0c51b4ca6492e4d8595e0">DimZ</a>;
  337. <a name="l00248"></a><a class="code" href="pumax_8c.html#a132288db6a5e56bd89aedf01da72b83f">00248</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a132288db6a5e56bd89aedf01da72b83f">DimXY</a>;
  338. <a name="l00249"></a><a class="code" href="pumax_8c.html#abec6f96b33294d2bb005f4aa387ee123">00249</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#abec6f96b33294d2bb005f4aa387ee123">Uindex</a> = -1;
  339. <a name="l00250"></a><a class="code" href="pumax_8c.html#abb16042facad6e19f6bdada929a4522a">00250</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#abb16042facad6e19f6bdada929a4522a">Vindex</a> = -1;
  340. <a name="l00251"></a><a class="code" href="pumax_8c.html#adac66095f3e07979226ef488bdf3d568">00251</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#adac66095f3e07979226ef488bdf3d568">ScreenD</a>;
  341. <a name="l00252"></a><a class="code" href="pumax_8c.html#a67c8f2f939a4939efcfc51b1a2edff05">00252</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a67c8f2f939a4939efcfc51b1a2edff05">OffX</a>;
  342. <a name="l00253"></a><a class="code" href="pumax_8c.html#a10481cd98c85988914fe8442f4ba3d83">00253</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a10481cd98c85988914fe8442f4ba3d83">OffY</a> = 0;
  343. <a name="l00254"></a><a class="code" href="pumax_8c.html#a90fa18336f52663513916236b6c3f633">00254</a> <a class="code" href="pumax_8c.html#af03d9314df919290b49b331146eab250">INTXU</a> <a class="code" href="pumax_8c.html#a90fa18336f52663513916236b6c3f633">WinXSize</a>;
  344. <a name="l00255"></a><a class="code" href="pumax_8c.html#a48ba2c20a7bf82da8f16252eff21155f">00255</a> <a class="code" href="pumax_8c.html#af03d9314df919290b49b331146eab250">INTXU</a> <a class="code" href="pumax_8c.html#a48ba2c20a7bf82da8f16252eff21155f">WinYSize</a>;
  345. <a name="l00256"></a><a class="code" href="pumax_8c.html#a77751be4ce780fbc796f89264e0834ed">00256</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a77751be4ce780fbc796f89264e0834ed">InXSize</a>;
  346. <a name="l00257"></a><a class="code" href="pumax_8c.html#a2e0311fae05aa716cc8cd6669af5bf3a">00257</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a2e0311fae05aa716cc8cd6669af5bf3a">InYSize</a>;
  347. <a name="l00258"></a><a class="code" href="pumax_8c.html#af601e2b0de5522e6f9acdf65e5c43bc2">00258</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#af601e2b0de5522e6f9acdf65e5c43bc2">Latitudes</a>;
  348. <a name="l00259"></a><a class="code" href="pumax_8c.html#ab36270a976b49e0122723b7d3bd35b95">00259</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ab36270a976b49e0122723b7d3bd35b95">Lines</a>;
  349. <a name="l00260"></a><a class="code" href="pumax_8c.html#a37647cb75c90a99169413a49642c8611">00260</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a37647cb75c90a99169413a49642c8611">SizeChanged</a>;
  350. <a name="l00261"></a><a class="code" href="pumax_8c.html#ab21d9f37528b86a902a6729dd95ac59c">00261</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ab21d9f37528b86a902a6729dd95ac59c">Shutdown</a>;
  351. <a name="l00262"></a><a class="code" href="pumax_8c.html#a9666b9253809d418e00bcc929ee41c7d">00262</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a9666b9253809d418e00bcc929ee41c7d">Grid</a> = 1;
  352. <a name="l00263"></a><a class="code" href="pumax_8c.html#a6d9c0848297fe882ecce74ea9963f462">00263</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a6d9c0848297fe882ecce74ea9963f462">GridLabel</a> = 1;
  353. <a name="l00264"></a><a class="code" href="pumax_8c.html#a648bfcb426b534ebd09a13bb909de1fe">00264</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a648bfcb426b534ebd09a13bb909de1fe">WhitePix</a>;
  354. <a name="l00265"></a><a class="code" href="pumax_8c.html#abb3b996d0c52b1e0f9a831a8d937e2d1">00265</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#abb3b996d0c52b1e0f9a831a8d937e2d1">BlackPix</a>;
  355. <a name="l00266"></a><a class="code" href="pumax_8c.html#ad3d50d3f2f0fc27a24fc046d729b6155">00266</a> <span class="keywordtype">int</span> *<a class="code" href="pumax_8c.html#ad3d50d3f2f0fc27a24fc046d729b6155">Flag</a>;
  356. <a name="l00267"></a><a class="code" href="pumax_8c.html#a2614fd78fb3ee96f2b67767e60b66dfe">00267</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a2614fd78fb3ee96f2b67767e60b66dfe">FlagSize</a>;
  357. <a name="l00268"></a><a class="code" href="pumax_8c.html#a354c90bb46e1789fe52c4759474c2c89">00268</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a354c90bb46e1789fe52c4759474c2c89">nstep</a>;
  358. <a name="l00269"></a><a class="code" href="pumax_8c.html#ab9a7287ec3c070d1dffbd02bd4aa1c86">00269</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ab9a7287ec3c070d1dffbd02bd4aa1c86">MRpid</a>;
  359. <a name="l00270"></a><a class="code" href="pumax_8c.html#ab2b040ca53dcfaf86f045dc2179c9887">00270</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ab2b040ca53dcfaf86f045dc2179c9887">MRnum</a>;
  360. <a name="l00271"></a><a class="code" href="pumax_8c.html#a2ae9d213102d3a7fbde45a73783575d6">00271</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a2ae9d213102d3a7fbde45a73783575d6">wto</a>;
  361. <a name="l00272"></a><a class="code" href="pumax_8c.html#a7d187d3be57e785fee45a7dfc5475595">00272</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a7d187d3be57e785fee45a7dfc5475595">FirstKey</a>;
  362. <a name="l00273"></a><a class="code" href="pumax_8c.html#a715fabcdc382c085e09d0bd3a8a44419">00273</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a715fabcdc382c085e09d0bd3a8a44419">LastKey</a>;
  363. <a name="l00274"></a><a class="code" href="pumax_8c.html#a062a9acafe50b7d73d1215b89db404ca">00274</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a062a9acafe50b7d73d1215b89db404ca">SymsPerKey</a>;
  364. <a name="l00275"></a>00275
  365. <a name="l00276"></a><a class="code" href="pumax_8c.html#a54e4f2083c262944eff0a7bab8a38d45">00276</a> KeySym *<a class="code" href="pumax_8c.html#a54e4f2083c262944eff0a7bab8a38d45">KeyMap</a>;
  366. <a name="l00277"></a>00277
  367. <a name="l00278"></a><a class="code" href="pumax_8c.html#a30906e2ef97b75bee8e3bc1fa6a28fe5">00278</a> <span class="keywordtype">char</span> <a class="code" href="pumax_8c.html#a30906e2ef97b75bee8e3bc1fa6a28fe5">wtrun</a>[8];
  368. <a name="l00279"></a>00279
  369. <a name="l00280"></a><a class="code" href="pumax_8c.html#ac598ebcf7264580721b98e54e677f6a5">00280</a> <span class="keywordtype">unsigned</span> <a class="code" href="pumax_8c.html#ac598ebcf7264580721b98e54e677f6a5">Seed</a>;
  370. <a name="l00281"></a>00281
  371. <a name="l00282"></a><a class="code" href="pumax_8c.html#aa62b318359708cb3e3c6f55cac884a6f">00282</a> <span class="keywordtype">float</span> <a class="code" href="pumax_8c.html#aa62b318359708cb3e3c6f55cac884a6f">RotInc</a> = 0.2;
  372. <a name="l00283"></a><a class="code" href="pumax_8c.html#ab3b6560558b106451f0c595266a4008b">00283</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ab3b6560558b106451f0c595266a4008b">LineCo</a>[<a class="code" href="pumax_8c.html#afa68e13002f97f4041b7acca426be273">NUMPAL</a>];
  373. <a name="l00284"></a><a class="code" href="pumax_8c.html#aff0dad8f0ac5215da2a7c4b11c3e4468">00284</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#aff0dad8f0ac5215da2a7c4b11c3e4468">MapPro</a>[<a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>];
  374. <a name="l00285"></a><a class="code" href="pumax_8c.html#a2182d818b0a9e826a785d20569737ccd">00285</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a2182d818b0a9e826a785d20569737ccd">HovInx</a>[<a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>];
  375. <a name="l00286"></a><a class="code" href="pumax_8c.html#a11dbbddba6dfe322e045aad50cc5574d">00286</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a11dbbddba6dfe322e045aad50cc5574d">Indez</a>[<a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>];
  376. <a name="l00287"></a><a class="code" href="pumax_8c.html#a21866fc3d7bd54b53ffe87891960f97a">00287</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a21866fc3d7bd54b53ffe87891960f97a">MaxZ</a>[<a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>];
  377. <a name="l00288"></a><a class="code" href="pumax_8c.html#a3f73bc9148abc81a853c4228c6b87a00">00288</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a3f73bc9148abc81a853c4228c6b87a00">RedrawFlag</a>[<a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>];
  378. <a name="l00289"></a><a class="code" href="pumax_8c.html#ac09f2715f235eaeb2b9696ebdab80d52">00289</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ac09f2715f235eaeb2b9696ebdab80d52">LevelChanged</a>[<a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>];
  379. <a name="l00290"></a><a class="code" href="pumax_8c.html#ac6850477764909ccb55d8738e5c2d305">00290</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ac6850477764909ccb55d8738e5c2d305">RotLon</a>[<a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>];
  380. <a name="l00291"></a><a class="code" href="pumax_8c.html#a3d10b63bd2fac264767466d69695742c">00291</a> <span class="keywordtype">double</span> <a class="code" href="pumax_8c.html#a3d10b63bd2fac264767466d69695742c">AutoDelta</a>[<a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>];
  381. <a name="l00292"></a><a class="code" href="pumax_8c.html#a6bd313ef1429f92259b6593d39648d60">00292</a> <span class="keywordtype">double</span> <a class="code" href="pumax_8c.html#a6bd313ef1429f92259b6593d39648d60">AutoXdelt</a>[<a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>];
  382. <a name="l00293"></a><a class="code" href="pumax_8c.html#af384ac77c027bcbfc55da730907d6ec9">00293</a> <span class="keywordtype">double</span> <a class="code" href="pumax_8c.html#af384ac77c027bcbfc55da730907d6ec9">AutoLo</a>[<a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>];
  383. <a name="l00294"></a><a class="code" href="pumax_8c.html#afcb1ab97f5789b6011d9d36d9da23e16">00294</a> <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> *<a class="code" href="pumax_8c.html#afcb1ab97f5789b6011d9d36d9da23e16">TSdata</a>[<a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>];
  384. <a name="l00295"></a><a class="code" href="pumax_8c.html#a0f50dd877e595f2d0cce25934fe6b036">00295</a> <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> *<a class="code" href="pumax_8c.html#a0f50dd877e595f2d0cce25934fe6b036">Dmin</a>[<a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>];
  385. <a name="l00296"></a><a class="code" href="pumax_8c.html#a0f00e6341c497388e98aab4c31d315b1">00296</a> <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> *<a class="code" href="pumax_8c.html#a0f00e6341c497388e98aab4c31d315b1">Dmax</a>[<a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>];
  386. <a name="l00297"></a><a class="code" href="pumax_8c.html#adfd726c7badd3f4544bd2dced3370b55">00297</a> <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> *<a class="code" href="pumax_8c.html#adfd726c7badd3f4544bd2dced3370b55">SpeedScale</a>;
  387. <a name="l00298"></a><a class="code" href="pumax_8c.html#ad7b7228c407befc7b493ab605367f826">00298</a> XPoint *<a class="code" href="pumax_8c.html#ad7b7228c407befc7b493ab605367f826">TSxp</a>[<a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>];
  388. <a name="l00299"></a>00299
  389. <a name="l00300"></a>00300
  390. <a name="l00301"></a><a class="code" href="pumax_8c.html#ab5a0dcea45727946af71ece4d11e0278">00301</a> <span class="preprocessor">#define MAXPAR 16384</span>
  391. <a name="l00302"></a><a class="code" href="pumax_8c.html#ab78a69f0e1b74a165ba4532edf790fa9">00302</a> <span class="preprocessor"></span><span class="keywordtype">float</span> <a class="code" href="pumax_8c.html#ab78a69f0e1b74a165ba4532edf790fa9">pax</a>[<a class="code" href="pumax_8c.html#ab5a0dcea45727946af71ece4d11e0278">MAXPAR</a>];
  392. <a name="l00303"></a><a class="code" href="pumax_8c.html#a43bc8d599fb2e9201171d162aa46914a">00303</a> <span class="keywordtype">float</span> <a class="code" href="pumax_8c.html#a43bc8d599fb2e9201171d162aa46914a">pay</a>[<a class="code" href="pumax_8c.html#ab5a0dcea45727946af71ece4d11e0278">MAXPAR</a>];
  393. <a name="l00304"></a><a class="code" href="pumax_8c.html#a90b1e0ef9cf6b06a7711e79eaa1e0618">00304</a> <span class="keywordtype">long</span> <a class="code" href="pumax_8c.html#a90b1e0ef9cf6b06a7711e79eaa1e0618">pal</a>[<a class="code" href="pumax_8c.html#ab5a0dcea45727946af71ece4d11e0278">MAXPAR</a>];
  394. <a name="l00305"></a>00305
  395. <a name="l00306"></a><a class="code" href="pumax_8c.html#a4953e093f6fdda1d77968eb75bc0ba4d">00306</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a4953e093f6fdda1d77968eb75bc0ba4d">Delpar</a> = 8; <span class="comment">/* Interval for particle injection */</span>
  396. <a name="l00307"></a><a class="code" href="pumax_8c.html#ad9c64621bb1d0a098f803d806afe7549">00307</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ad9c64621bb1d0a098f803d806afe7549">ParInd</a> = 0;
  397. <a name="l00308"></a><a class="code" href="pumax_8c.html#ad3a3fa1de4fcbf5d06e0ac6277cb85a3">00308</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ad3a3fa1de4fcbf5d06e0ac6277cb85a3">ColInd</a> = 0;
  398. <a name="l00309"></a><a class="code" href="pumax_8c.html#a593e4a6696ba37b5108d683e031afc64">00309</a> <span class="keywordtype">long</span> <a class="code" href="pumax_8c.html#a593e4a6696ba37b5108d683e031afc64">TracerColor</a>;
  399. <a name="l00310"></a>00310
  400. <a name="l00311"></a><a class="code" href="pumax_8c.html#a82714a35091aa707ef0bc4c0ad18d7b2">00311</a> <span class="preprocessor">#define NUMSCALARS 9</span>
  401. <a name="l00312"></a>00312 <span class="preprocessor"></span>
  402. <a name="l00313"></a><a class="code" href="pumax_8c.html#aca4aea981815a0d54f9e4c49b70caf16">00313</a> <span class="keywordtype">char</span> <a class="code" href="pumax_8c.html#aca4aea981815a0d54f9e4c49b70caf16">TSName</a>[<a class="code" href="pumax_8c.html#a82714a35091aa707ef0bc4c0ad18d7b2">NUMSCALARS</a>][80];
  403. <a name="l00314"></a><a class="code" href="pumax_8c.html#a17ab69aa93eabd4faa61b559ac70b194">00314</a> <span class="keywordtype">char</span> <a class="code" href="pumax_8c.html#a17ab69aa93eabd4faa61b559ac70b194">TSubsc</a>[<a class="code" href="pumax_8c.html#a82714a35091aa707ef0bc4c0ad18d7b2">NUMSCALARS</a>][80];
  404. <a name="l00315"></a><a class="code" href="pumax_8c.html#a23076268f919a12b29a37f9c5d334529">00315</a> <span class="keywordtype">char</span> <a class="code" href="pumax_8c.html#a23076268f919a12b29a37f9c5d334529">TSUnit</a>[<a class="code" href="pumax_8c.html#a82714a35091aa707ef0bc4c0ad18d7b2">NUMSCALARS</a>][80];
  405. <a name="l00316"></a><a class="code" href="pumax_8c.html#a57f73cea5ae7a40e4d3b0a63dd7e09e8">00316</a> <span class="keywordtype">char</span> <a class="code" href="pumax_8c.html#a57f73cea5ae7a40e4d3b0a63dd7e09e8">TScale</a>[<a class="code" href="pumax_8c.html#a82714a35091aa707ef0bc4c0ad18d7b2">NUMSCALARS</a>][80];
  406. <a name="l00317"></a>00317
  407. <a name="l00318"></a><a class="code" href="struct_pix_struct.html">00318</a> <span class="keyword">struct </span><a class="code" href="struct_pix_struct.html">PixStruct</a>
  408. <a name="l00319"></a>00319 {
  409. <a name="l00320"></a><a class="code" href="struct_pix_struct.html#a8cfaa77a4a7e9675273fce59dc437ef4">00320</a> <span class="keywordtype">int</span> <a class="code" href="struct_pix_struct.html#a8cfaa77a4a7e9675273fce59dc437ef4">DimX</a>;
  410. <a name="l00321"></a><a class="code" href="struct_pix_struct.html#a605b726f604da7ec98575dec3da238c8">00321</a> <span class="keywordtype">int</span> <a class="code" href="struct_pix_struct.html#a605b726f604da7ec98575dec3da238c8">DimY</a>;
  411. <a name="l00322"></a><a class="code" href="struct_pix_struct.html#a7e7807591a26e2daa2f16ad2599a2b34">00322</a> Pixmap <a class="code" href="struct_pix_struct.html#a7e7807591a26e2daa2f16ad2599a2b34">Pix</a>;
  412. <a name="l00323"></a>00323 } <a class="code" href="pumax_8c.html#a66932718d5aaaf8cd382d6e8e681b96a">WinPixMap</a>[<a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>];
  413. <a name="l00324"></a>00324
  414. <a name="l00325"></a><a class="code" href="pumax_8c.html#aef9028fc102a39f0faed1ec344a4e9e2">00325</a> Pixmap <a class="code" href="pumax_8c.html#aef9028fc102a39f0faed1ec344a4e9e2">pix</a>;
  415. <a name="l00326"></a>00326
  416. <a name="l00327"></a><a class="code" href="pumax_8c.html#a1e80731889ffe5f09aad20a7641c13d0">00327</a> <span class="preprocessor">#define NUMARRAYS 100</span>
  417. <a name="l00328"></a>00328 <span class="preprocessor"></span>
  418. <a name="l00329"></a><a class="code" href="struct_array_struct.html">00329</a> <span class="keyword">struct </span><a class="code" href="struct_array_struct.html">ArrayStruct</a>
  419. <a name="l00330"></a>00330 {
  420. <a name="l00331"></a><a class="code" href="struct_array_struct.html#ae5bd936d5280e2021bdd3b61f51c31d4">00331</a> <span class="keywordtype">char</span> <a class="code" href="struct_array_struct.html#ae5bd936d5280e2021bdd3b61f51c31d4">Name</a>[80];
  421. <a name="l00332"></a><a class="code" href="struct_array_struct.html#a38c55a484b3d01e2ffa11f14de2adfd9">00332</a> <span class="keywordtype">float</span> *<a class="code" href="struct_array_struct.html#a38c55a484b3d01e2ffa11f14de2adfd9">Data</a>;
  422. <a name="l00333"></a><a class="code" href="struct_array_struct.html#a51fc8e81440a7098077d179fca8d63b8">00333</a> <span class="keywordtype">int</span> <a class="code" href="struct_array_struct.html#a51fc8e81440a7098077d179fca8d63b8">DimX</a>;
  423. <a name="l00334"></a><a class="code" href="struct_array_struct.html#a73fc2a83ee5c78d73b0f4389a0771afb">00334</a> <span class="keywordtype">int</span> <a class="code" href="struct_array_struct.html#a73fc2a83ee5c78d73b0f4389a0771afb">DimY</a>;
  424. <a name="l00335"></a><a class="code" href="struct_array_struct.html#a53f6572c6d936b07f27d8d6fb9acb915">00335</a> <span class="keywordtype">int</span> <a class="code" href="struct_array_struct.html#a53f6572c6d936b07f27d8d6fb9acb915">DimZ</a>;
  425. <a name="l00336"></a><a class="code" href="struct_array_struct.html#a00b2e20e7e3b5c5f3cf3e9e6cee16ca3">00336</a> <span class="keywordtype">int</span> <a class="code" href="struct_array_struct.html#a00b2e20e7e3b5c5f3cf3e9e6cee16ca3">Flag</a>;
  426. <a name="l00337"></a>00337 } <a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[<a class="code" href="pumax_8c.html#a1e80731889ffe5f09aad20a7641c13d0">NUMARRAYS</a>];
  427. <a name="l00338"></a>00338
  428. <a name="l00339"></a><a class="code" href="pumax_8c.html#a66a0f3add0dee72c7f3811b88249a9b6">00339</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a66a0f3add0dee72c7f3811b88249a9b6">NumArrays</a>;
  429. <a name="l00340"></a>00340
  430. <a name="l00341"></a><a class="code" href="struct_win_att_struct.html">00341</a> <span class="keyword">struct </span><a class="code" href="struct_win_att_struct.html">WinAttStruct</a>
  431. <a name="l00342"></a>00342 {
  432. <a name="l00343"></a><a class="code" href="struct_win_att_struct.html#aa00d94640c9eb39ceac56f95c595f62a">00343</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="struct_win_att_struct.html#aa00d94640c9eb39ceac56f95c595f62a">x</a>;
  433. <a name="l00344"></a><a class="code" href="struct_win_att_struct.html#a770cabf1d350db5890f636ccf30e5d47">00344</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="struct_win_att_struct.html#a770cabf1d350db5890f636ccf30e5d47">y</a>;
  434. <a name="l00345"></a><a class="code" href="struct_win_att_struct.html#a6e7f8041c23d41b7d2835a2b855d35f0">00345</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="struct_win_att_struct.html#a6e7f8041c23d41b7d2835a2b855d35f0">w</a>;
  435. <a name="l00346"></a><a class="code" href="struct_win_att_struct.html#aa9c1c94dee4ebbe95eb392f738835055">00346</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="struct_win_att_struct.html#aa9c1c94dee4ebbe95eb392f738835055">h</a>;
  436. <a name="l00347"></a><a class="code" href="struct_win_att_struct.html#abd4485f9d84ad074c80fc4127922cb19">00347</a> <span class="keywordtype">int</span> <a class="code" href="struct_win_att_struct.html#abd4485f9d84ad074c80fc4127922cb19">active</a>;
  437. <a name="l00348"></a><a class="code" href="struct_win_att_struct.html#a160c20895e7f5cd3463c955778f18338">00348</a> <span class="keywordtype">char</span> <a class="code" href="struct_win_att_struct.html#a160c20895e7f5cd3463c955778f18338">array_name</a>[80];
  438. <a name="l00349"></a><a class="code" href="struct_win_att_struct.html#ac172f6d90a125507144c20f703b4a0d4">00349</a> <span class="keywordtype">int</span> <a class="code" href="struct_win_att_struct.html#ac172f6d90a125507144c20f703b4a0d4">Plot</a>;
  439. <a name="l00350"></a><a class="code" href="struct_win_att_struct.html#a75ef0752e759450856fd5967bdb36587">00350</a> <span class="keywordtype">int</span> <a class="code" href="struct_win_att_struct.html#a75ef0752e759450856fd5967bdb36587">Palette</a>;
  440. <a name="l00351"></a>00351 } <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[<a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>];
  441. <a name="l00352"></a>00352
  442. <a name="l00353"></a><a class="code" href="pumax_8c.html#a4c676748bf23de0139afe73b216c2bd6">00353</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a4c676748bf23de0139afe73b216c2bd6">BorderWidth</a> = 0;
  443. <a name="l00354"></a><a class="code" href="pumax_8c.html#a6e0e87f9eb0c26037ddf9147bf56f097">00354</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a6e0e87f9eb0c26037ddf9147bf56f097">WM_top_area</a> = 0; <span class="comment">// Window manager top area</span>
  444. <a name="l00355"></a><a class="code" href="pumax_8c.html#a0a8a8622ae71c04112e4e0d9ccda7817">00355</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a0a8a8622ae71c04112e4e0d9ccda7817">WinLM</a> = 0;
  445. <a name="l00356"></a><a class="code" href="pumax_8c.html#a261f1b75cb979500af635c616e19771d">00356</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a261f1b75cb979500af635c616e19771d">WinRM</a> = 0;
  446. <a name="l00357"></a><a class="code" href="pumax_8c.html#a6529bd28fe04607bb7d71ff00a101e52">00357</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a6529bd28fe04607bb7d71ff00a101e52">WinTM</a> = 24;
  447. <a name="l00358"></a><a class="code" href="pumax_8c.html#ad6e080222bafe5cdc477c0a8ae13d144">00358</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ad6e080222bafe5cdc477c0a8ae13d144">WinBM</a> = 0;
  448. <a name="l00359"></a>00359
  449. <a name="l00360"></a><a class="code" href="struct_color_strip.html">00360</a> <span class="keyword">struct </span><a class="code" href="struct_color_strip.html">ColorStrip</a>
  450. <a name="l00361"></a>00361 {
  451. <a name="l00362"></a><a class="code" href="struct_color_strip.html#a4f6280212828381ae297b3f9565e7ce8">00362</a> <span class="keywordtype">double</span> <a class="code" href="struct_color_strip.html#a4f6280212828381ae297b3f9565e7ce8">Lo</a>;
  452. <a name="l00363"></a><a class="code" href="struct_color_strip.html#a6deff3a5a5614df503a3af930233730b">00363</a> <span class="keywordtype">double</span> <a class="code" href="struct_color_strip.html#a6deff3a5a5614df503a3af930233730b">Hi</a>;
  453. <a name="l00364"></a><a class="code" href="struct_color_strip.html#a8be72b425d4dae5555815f0108a2a2b9">00364</a> <span class="keywordtype">char</span> *<a class="code" href="struct_color_strip.html#a8be72b425d4dae5555815f0108a2a2b9">Name</a>;
  454. <a name="l00365"></a><a class="code" href="struct_color_strip.html#ab1a6137a580d2a1817f4d8e127d4743c">00365</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="struct_color_strip.html#ab1a6137a580d2a1817f4d8e127d4743c">pixel</a>;
  455. <a name="l00366"></a>00366 };
  456. <a name="l00367"></a>00367
  457. <a name="l00368"></a><a class="code" href="pumax_8c.html#a7f2aa7d59c57b8054e230e2f72564671">00368</a> <span class="preprocessor">#define AUTOCOLORS 14</span>
  458. <a name="l00369"></a><a class="code" href="pumax_8c.html#a0f1e694b411614c27c69b2b2ac6d293d">00369</a> <span class="preprocessor"></span><span class="keyword">struct </span><a class="code" href="struct_color_strip.html">ColorStrip</a> <a class="code" href="pumax_8c.html#a0f1e694b411614c27c69b2b2ac6d293d">Autostrip</a>[<a class="code" href="pumax_8c.html#a7f2aa7d59c57b8054e230e2f72564671">AUTOCOLORS</a>+1] =
  459. <a name="l00370"></a>00370 {
  460. <a name="l00371"></a>00371 {0.0,0.0,<span class="stringliteral">&quot;red&quot;</span>},
  461. <a name="l00372"></a>00372 {0.0,0.0,<span class="stringliteral">&quot;OrangeRed&quot;</span>},
  462. <a name="l00373"></a>00373 {0.0,0.0,<span class="stringliteral">&quot;Orange&quot;</span>},
  463. <a name="l00374"></a>00374 {0.0,0.0,<span class="stringliteral">&quot;yellow&quot;</span>},
  464. <a name="l00375"></a>00375 {0.0,0.0,<span class="stringliteral">&quot;GreenYellow&quot;</span>},
  465. <a name="l00376"></a>00376 {0.0,0.0,<span class="stringliteral">&quot;green&quot;</span>},
  466. <a name="l00377"></a>00377 {0.0,0.0,<span class="stringliteral">&quot;aquamarine&quot;</span>},
  467. <a name="l00378"></a>00378 {0.0,0.0,<span class="stringliteral">&quot;cyan&quot;</span>},
  468. <a name="l00379"></a>00379 {0.0,0.0,<span class="stringliteral">&quot;SkyBlue&quot;</span>},
  469. <a name="l00380"></a>00380 {0.0,0.0,<span class="stringliteral">&quot;blue&quot;</span>},
  470. <a name="l00381"></a>00381 {0.0,0.0,<span class="stringliteral">&quot;orchid&quot;</span>},
  471. <a name="l00382"></a>00382 {0.0,0.0,<span class="stringliteral">&quot;magenta&quot;</span>},
  472. <a name="l00383"></a>00383 {0.0,0.0,<span class="stringliteral">&quot;violet&quot;</span>},
  473. <a name="l00384"></a>00384 {0.0,0.0,<span class="stringliteral">&quot;DarkViolet&quot;</span>},
  474. <a name="l00385"></a>00385 {0.0,0.0,NULL}
  475. <a name="l00386"></a>00386 };
  476. <a name="l00387"></a>00387
  477. <a name="l00388"></a><a class="code" href="pumax_8c.html#a27585cbf21e1ba9c7dd6ddc80b53a483">00388</a> <span class="keyword">struct </span><a class="code" href="struct_color_strip.html">ColorStrip</a> <a class="code" href="pumax_8c.html#a27585cbf21e1ba9c7dd6ddc80b53a483">Ustrip</a>[] =
  478. <a name="l00389"></a>00389 {
  479. <a name="l00390"></a>00390 {-99.0,-10.0,<span class="stringliteral">&quot;red&quot;</span>},
  480. <a name="l00391"></a>00391 {-10.0, -5.0,<span class="stringliteral">&quot;OrangeRed&quot;</span>},
  481. <a name="l00392"></a>00392 { -5.0, 0.0,<span class="stringliteral">&quot;Orange&quot;</span>},
  482. <a name="l00393"></a>00393 { 0.0, 5.0,<span class="stringliteral">&quot;yellow&quot;</span>},
  483. <a name="l00394"></a>00394 { 5.0, 10.0,<span class="stringliteral">&quot;GreenYellow&quot;</span>},
  484. <a name="l00395"></a>00395 { 10.0, 15.0,<span class="stringliteral">&quot;green&quot;</span>},
  485. <a name="l00396"></a>00396 { 15.0, 20.0,<span class="stringliteral">&quot;aquamarine&quot;</span>},
  486. <a name="l00397"></a>00397 { 20.0, 25.0,<span class="stringliteral">&quot;cyan&quot;</span>},
  487. <a name="l00398"></a>00398 { 25.0, 30.0,<span class="stringliteral">&quot;SkyBlue&quot;</span>},
  488. <a name="l00399"></a>00399 { 30.0, 35.0,<span class="stringliteral">&quot;blue&quot;</span>},
  489. <a name="l00400"></a>00400 { 35.0, 40.0,<span class="stringliteral">&quot;orchid&quot;</span>},
  490. <a name="l00401"></a>00401 { 40.0, 45.0,<span class="stringliteral">&quot;magenta&quot;</span>},
  491. <a name="l00402"></a>00402 { 45.0, 50.0,<span class="stringliteral">&quot;violet&quot;</span>},
  492. <a name="l00403"></a>00403 { 50.0, 99.0,<span class="stringliteral">&quot;DarkViolet&quot;</span>},
  493. <a name="l00404"></a>00404 { 0.0, 0.0,NULL}
  494. <a name="l00405"></a>00405 };
  495. <a name="l00406"></a>00406
  496. <a name="l00407"></a><a class="code" href="pumax_8c.html#a8ca74da35be1e45958cd987830c0ac4a">00407</a> <span class="keyword">struct </span><a class="code" href="struct_color_strip.html">ColorStrip</a> <a class="code" href="pumax_8c.html#a8ca74da35be1e45958cd987830c0ac4a">Qstrip</a>[] =
  497. <a name="l00408"></a>00408 {
  498. <a name="l00409"></a>00409 {-99.0, 0.0,<span class="stringliteral">&quot;black&quot;</span>},
  499. <a name="l00410"></a>00410 { 0.0, 5.0,<span class="stringliteral">&quot;OrangeRed&quot;</span>},
  500. <a name="l00411"></a>00411 { 5.0, 10.0,<span class="stringliteral">&quot;Orange&quot;</span>},
  501. <a name="l00412"></a>00412 { 10.0, 15.0,<span class="stringliteral">&quot;yellow&quot;</span>},
  502. <a name="l00413"></a>00413 { 15.0, 20.0,<span class="stringliteral">&quot;GreenYellow&quot;</span>},
  503. <a name="l00414"></a>00414 { 20.0, 25.0,<span class="stringliteral">&quot;green&quot;</span>},
  504. <a name="l00415"></a>00415 { 25.0, 30.0,<span class="stringliteral">&quot;aquamarine&quot;</span>},
  505. <a name="l00416"></a>00416 { 30.0, 35.0,<span class="stringliteral">&quot;cyan&quot;</span>},
  506. <a name="l00417"></a>00417 { 35.0, 40.0,<span class="stringliteral">&quot;SkyBlue&quot;</span>},
  507. <a name="l00418"></a>00418 { 40.0, 45.0,<span class="stringliteral">&quot;blue&quot;</span>},
  508. <a name="l00419"></a>00419 { 45.0, 50.0,<span class="stringliteral">&quot;orchid&quot;</span>},
  509. <a name="l00420"></a>00420 { 50.0, 55.0,<span class="stringliteral">&quot;magenta&quot;</span>},
  510. <a name="l00421"></a>00421 { 55.0, 60.0,<span class="stringliteral">&quot;violet&quot;</span>},
  511. <a name="l00422"></a>00422 { 60.0, 99.0,<span class="stringliteral">&quot;DarkViolet&quot;</span>},
  512. <a name="l00423"></a>00423 { 0.0, 0.0,NULL}
  513. <a name="l00424"></a>00424 };
  514. <a name="l00425"></a>00425
  515. <a name="l00426"></a><a class="code" href="pumax_8c.html#af20e4f75be17c991b9279e16d31b2f63">00426</a> <span class="keyword">struct </span><a class="code" href="struct_color_strip.html">ColorStrip</a> <a class="code" href="pumax_8c.html#af20e4f75be17c991b9279e16d31b2f63">Vstrip</a>[] =
  516. <a name="l00427"></a>00427 {
  517. <a name="l00428"></a>00428 {-99.0,-10.0,<span class="stringliteral">&quot;brown&quot;</span>},
  518. <a name="l00429"></a>00429 {-10.0, -8.0,<span class="stringliteral">&quot;gold&quot;</span>},
  519. <a name="l00430"></a>00430 { -8.0, -6.0,<span class="stringliteral">&quot;purple&quot;</span>},
  520. <a name="l00431"></a>00431 { -6.0, -4.0,<span class="stringliteral">&quot;red&quot;</span>},
  521. <a name="l00432"></a>00432 { -4.0, -2.0,<span class="stringliteral">&quot;OrangeRed&quot;</span>},
  522. <a name="l00433"></a>00433 { -2.0, 0.0,<span class="stringliteral">&quot;Orange&quot;</span>},
  523. <a name="l00434"></a>00434 { 0.0, 2.0,<span class="stringliteral">&quot;yellow&quot;</span>},
  524. <a name="l00435"></a>00435 { 2.0, 4.0,<span class="stringliteral">&quot;GreenYellow&quot;</span>},
  525. <a name="l00436"></a>00436 { 4.0, 6.0,<span class="stringliteral">&quot;green&quot;</span>},
  526. <a name="l00437"></a>00437 { 6.0, 8.0,<span class="stringliteral">&quot;aquamarine&quot;</span>},
  527. <a name="l00438"></a>00438 { 8.0, 10.0,<span class="stringliteral">&quot;cyan&quot;</span>},
  528. <a name="l00439"></a>00439 { 10.0, 99.0,<span class="stringliteral">&quot;blue&quot;</span>},
  529. <a name="l00440"></a>00440 { 0.0, 0.0,NULL}
  530. <a name="l00441"></a>00441 };
  531. <a name="l00442"></a>00442
  532. <a name="l00443"></a><a class="code" href="pumax_8c.html#a2f27d898c032b44d43e48cbf16abcbc9">00443</a> <span class="keyword">struct </span><a class="code" href="struct_color_strip.html">ColorStrip</a> <a class="code" href="pumax_8c.html#a2f27d898c032b44d43e48cbf16abcbc9">Tstrip</a>[] =
  533. <a name="l00444"></a>00444 {
  534. <a name="l00445"></a>00445 {-99.0,-50.0,<span class="stringliteral">&quot;MidnightBlue&quot;</span>},
  535. <a name="l00446"></a>00446 {-50.0,-40.0,<span class="stringliteral">&quot;RoyalBlue4&quot;</span>},
  536. <a name="l00447"></a>00447 {-40.0,-30.0,<span class="stringliteral">&quot;RoyalBlue3&quot;</span>},
  537. <a name="l00448"></a>00448 {-30.0,-20.0,<span class="stringliteral">&quot;RoyalBlue2&quot;</span>},
  538. <a name="l00449"></a>00449 {-20.0,-10.0,<span class="stringliteral">&quot;RoyalBlue1&quot;</span>},
  539. <a name="l00450"></a>00450 {-10.0, 0.0,<span class="stringliteral">&quot;violet&quot;</span>},
  540. <a name="l00451"></a>00451 { 0.0, 10.0,<span class="stringliteral">&quot;IndianRed1&quot;</span>},
  541. <a name="l00452"></a>00452 { 10.0, 20.0,<span class="stringliteral">&quot;IndianRed2&quot;</span>},
  542. <a name="l00453"></a>00453 { 20.0, 30.0,<span class="stringliteral">&quot;IndianRed3&quot;</span>},
  543. <a name="l00454"></a>00454 { 30.0, 40.0,<span class="stringliteral">&quot;IndianRed4&quot;</span>},
  544. <a name="l00455"></a>00455 { 40.0, 50.0,<span class="stringliteral">&quot;red&quot;</span>},
  545. <a name="l00456"></a>00456 { 0.0, 0.0,NULL}
  546. <a name="l00457"></a>00457 };
  547. <a name="l00458"></a>00458
  548. <a name="l00459"></a><a class="code" href="pumax_8c.html#a0704c1182f72d321dd1b94c8bfa4ea2d">00459</a> <span class="keyword">struct </span><a class="code" href="struct_color_strip.html">ColorStrip</a> <a class="code" href="pumax_8c.html#a0704c1182f72d321dd1b94c8bfa4ea2d">Kstrip</a>[] =
  549. <a name="l00460"></a>00460 {
  550. <a name="l00461"></a>00461 {100.0,210.0,<span class="stringliteral">&quot;RoyalBlue4&quot;</span>},
  551. <a name="l00462"></a>00462 {210.0,220.0,<span class="stringliteral">&quot;RoyalBlue3&quot;</span>},
  552. <a name="l00463"></a>00463 {220.0,230.0,<span class="stringliteral">&quot;RoyalBlue2&quot;</span>},
  553. <a name="l00464"></a>00464 {230.0,240.0,<span class="stringliteral">&quot;RoyalBlue1&quot;</span>},
  554. <a name="l00465"></a>00465 {240.0,250.0,<span class="stringliteral">&quot;violet&quot;</span>},
  555. <a name="l00466"></a>00466 {250.0,260.0,<span class="stringliteral">&quot;IndianRed1&quot;</span>},
  556. <a name="l00467"></a>00467 {260.0,270.0,<span class="stringliteral">&quot;IndianRed2&quot;</span>},
  557. <a name="l00468"></a>00468 {270.0,280.0,<span class="stringliteral">&quot;IndianRed3&quot;</span>},
  558. <a name="l00469"></a>00469 {280.0,290.0,<span class="stringliteral">&quot;IndianRed4&quot;</span>},
  559. <a name="l00470"></a>00470 {290.0,400.0,<span class="stringliteral">&quot;red&quot;</span>},
  560. <a name="l00471"></a>00471 { 0.0, 0.0,NULL}
  561. <a name="l00472"></a>00472 };
  562. <a name="l00473"></a>00473
  563. <a name="l00474"></a><a class="code" href="pumax_8c.html#acb534c740918af3e4435f39fd13430c2">00474</a> <span class="keyword">struct </span><a class="code" href="struct_color_strip.html">ColorStrip</a> <a class="code" href="pumax_8c.html#acb534c740918af3e4435f39fd13430c2">Pstrip</a>[] =
  564. <a name="l00475"></a>00475 {
  565. <a name="l00476"></a>00476 { 00.0, 985.0,<span class="stringliteral">&quot;RoyalBlue4&quot;</span>},
  566. <a name="l00477"></a>00477 { 985.0, 990.0,<span class="stringliteral">&quot;RoyalBlue3&quot;</span>},
  567. <a name="l00478"></a>00478 { 990.0, 995.0,<span class="stringliteral">&quot;RoyalBlue2&quot;</span>},
  568. <a name="l00479"></a>00479 { 995.0,1000.0,<span class="stringliteral">&quot;RoyalBlue1&quot;</span>},
  569. <a name="l00480"></a>00480 {1000.0,1005.0,<span class="stringliteral">&quot;violet&quot;</span>},
  570. <a name="l00481"></a>00481 {1005.0,1010.0,<span class="stringliteral">&quot;IndianRed1&quot;</span>},
  571. <a name="l00482"></a>00482 {1010.0,1015.0,<span class="stringliteral">&quot;IndianRed2&quot;</span>},
  572. <a name="l00483"></a>00483 {1015.0,1020.0,<span class="stringliteral">&quot;IndianRed3&quot;</span>},
  573. <a name="l00484"></a>00484 {1020.0,1025.0,<span class="stringliteral">&quot;IndianRed4&quot;</span>},
  574. <a name="l00485"></a>00485 {1025.0,9990.0,<span class="stringliteral">&quot;red&quot;</span>},
  575. <a name="l00486"></a>00486 { 0.0, 0.0,NULL}
  576. <a name="l00487"></a>00487 };
  577. <a name="l00488"></a>00488
  578. <a name="l00489"></a><a class="code" href="pumax_8c.html#a61c5742f58c9f2060723b084e1b07877">00489</a> <span class="keyword">struct </span><a class="code" href="struct_color_strip.html">ColorStrip</a> <a class="code" href="pumax_8c.html#a61c5742f58c9f2060723b084e1b07877">MarsTStrip</a>[] =
  579. <a name="l00490"></a>00490 {
  580. <a name="l00491"></a>00491 {-200.0,-90.0,<span class="stringliteral">&quot;RoyalBlue4&quot;</span>},
  581. <a name="l00492"></a>00492 { -90.0,-80.0,<span class="stringliteral">&quot;RoyalBlue3&quot;</span>},
  582. <a name="l00493"></a>00493 { -80.0,-70.0,<span class="stringliteral">&quot;RoyalBlue2&quot;</span>},
  583. <a name="l00494"></a>00494 { -70.0,-60.0,<span class="stringliteral">&quot;RoyalBlue1&quot;</span>},
  584. <a name="l00495"></a>00495 { -60.0,-50.0,<span class="stringliteral">&quot;violet&quot;</span>},
  585. <a name="l00496"></a>00496 { -50.0,-40.0,<span class="stringliteral">&quot;IndianRed1&quot;</span>},
  586. <a name="l00497"></a>00497 { -40.0,-30.0,<span class="stringliteral">&quot;IndianRed2&quot;</span>},
  587. <a name="l00498"></a>00498 { -30.0,-20.0,<span class="stringliteral">&quot;IndianRed3&quot;</span>},
  588. <a name="l00499"></a>00499 { -20.0, 0.0,<span class="stringliteral">&quot;IndianRed4&quot;</span>},
  589. <a name="l00500"></a>00500 { 0.0,100.0,<span class="stringliteral">&quot;red&quot;</span>},
  590. <a name="l00501"></a>00501 { 0.0, 0.0,NULL}
  591. <a name="l00502"></a>00502 };
  592. <a name="l00503"></a>00503
  593. <a name="l00504"></a><a class="code" href="pumax_8c.html#a8b073841e9a0dd00c1ccefa59fa89ca2">00504</a> <span class="keyword">struct </span><a class="code" href="struct_color_strip.html">ColorStrip</a> <a class="code" href="pumax_8c.html#a8b073841e9a0dd00c1ccefa59fa89ca2">AmpliStrip</a>[] =
  594. <a name="l00505"></a>00505 {
  595. <a name="l00506"></a>00506 { 0.0, 1.0,<span class="stringliteral">&quot;DarkBlue&quot;</span>},
  596. <a name="l00507"></a>00507 { 8.0, 9.0,<span class="stringliteral">&quot;blue&quot;</span>},
  597. <a name="l00508"></a>00508 { 8.0, 9.0,<span class="stringliteral">&quot;DarkGreen&quot;</span>},
  598. <a name="l00509"></a>00509 { 8.0, 9.0,<span class="stringliteral">&quot;green&quot;</span>},
  599. <a name="l00510"></a>00510 { 8.0, 9.0,<span class="stringliteral">&quot;yellow&quot;</span>},
  600. <a name="l00511"></a>00511 { 9.0, 10.0,<span class="stringliteral">&quot;Orange&quot;</span>},
  601. <a name="l00512"></a>00512 { 10.0, 11.0,<span class="stringliteral">&quot;OrangeRed&quot;</span>},
  602. <a name="l00513"></a>00513 { 11.0, 12.0,<span class="stringliteral">&quot;red&quot;</span>},
  603. <a name="l00514"></a>00514 { 0.0, 0.0,NULL}
  604. <a name="l00515"></a>00515 };
  605. <a name="l00516"></a>00516
  606. <a name="l00517"></a><a class="code" href="pumax_8c.html#a72a78f98da890d213dc68dbc61ea6a64">00517</a> <span class="keyword">struct </span><a class="code" href="struct_color_strip.html">ColorStrip</a> <a class="code" href="pumax_8c.html#a72a78f98da890d213dc68dbc61ea6a64">Vegstrip</a>[] =
  607. <a name="l00518"></a>00518 {
  608. <a name="l00519"></a>00519 {-999.9,0.001,<span class="stringliteral">&quot;DarkBlue&quot;</span>},
  609. <a name="l00520"></a>00520 { 0.001, 10.0,<span class="stringliteral">&quot;brown&quot;</span>},
  610. <a name="l00521"></a>00521 { 10.0, 20.0,<span class="stringliteral">&quot;SeaGreen4&quot;</span>},
  611. <a name="l00522"></a>00522 { 20.0, 30.0,<span class="stringliteral">&quot;SeaGreen3&quot;</span>},
  612. <a name="l00523"></a>00523 { 30.0, 40.0,<span class="stringliteral">&quot;SeaGreen2&quot;</span>},
  613. <a name="l00524"></a>00524 { 40.0, 50.0,<span class="stringliteral">&quot;SeaGreen1&quot;</span>},
  614. <a name="l00525"></a>00525 { 50.0, 60.0,<span class="stringliteral">&quot;YellowGreen&quot;</span>},
  615. <a name="l00526"></a>00526 { 60.0, 70.0,<span class="stringliteral">&quot;green4&quot;</span>},
  616. <a name="l00527"></a>00527 { 70.0, 80.0,<span class="stringliteral">&quot;green3&quot;</span>},
  617. <a name="l00528"></a>00528 { 80.0, 90.0,<span class="stringliteral">&quot;green2&quot;</span>},
  618. <a name="l00529"></a>00529 { 90.0,999.0,<span class="stringliteral">&quot;green1&quot;</span>},
  619. <a name="l00530"></a>00530 { 0.0, 0.0,NULL}
  620. <a name="l00531"></a>00531 };
  621. <a name="l00532"></a>00532
  622. <a name="l00533"></a><a class="code" href="pumax_8c.html#ad8ac7fab8931a9e76a31db92b88002e6">00533</a> <span class="keyword">struct </span><a class="code" href="struct_color_strip.html">ColorStrip</a> <a class="code" href="pumax_8c.html#ad8ac7fab8931a9e76a31db92b88002e6">Tstripoce</a>[] =
  623. <a name="l00534"></a>00534 {
  624. <a name="l00535"></a>00535 {-99.0, 0.00001,<span class="stringliteral">&quot;Black&quot;</span>},
  625. <a name="l00536"></a>00536 { 0.00001, 4.0 ,<span class="stringliteral">&quot;RoyalBlue4&quot;</span>},
  626. <a name="l00537"></a>00537 { 4.0 ,8.0,<span class="stringliteral">&quot;RoyalBlue3&quot;</span>},
  627. <a name="l00538"></a>00538 { 8.0, 12.0,<span class="stringliteral">&quot;RoyalBlue2&quot;</span>},
  628. <a name="l00539"></a>00539 { 12.0, 16.0,<span class="stringliteral">&quot;RoyalBlue1&quot;</span>},
  629. <a name="l00540"></a>00540 { 16.0, 20.0,<span class="stringliteral">&quot;violet&quot;</span>},
  630. <a name="l00541"></a>00541 { 20.0, 24.0,<span class="stringliteral">&quot;IndianRed1&quot;</span>},
  631. <a name="l00542"></a>00542 { 24.0, 28.0,<span class="stringliteral">&quot;IndianRed2&quot;</span>},
  632. <a name="l00543"></a>00543 { 28.0, 32.0,<span class="stringliteral">&quot;IndianRed3&quot;</span>},
  633. <a name="l00544"></a>00544 { 32.0, 36.0,<span class="stringliteral">&quot;IndianRed4&quot;</span>},
  634. <a name="l00545"></a>00545 { 36.0, 40.0,<span class="stringliteral">&quot;red&quot;</span>},
  635. <a name="l00546"></a>00546 { 0.0, 0.0,NULL}
  636. <a name="l00547"></a>00547 };
  637. <a name="l00548"></a>00548
  638. <a name="l00549"></a><a class="code" href="pumax_8c.html#ac548e93acae78e8960939467fa588661">00549</a> <span class="keyword">struct </span><a class="code" href="struct_color_strip.html">ColorStrip</a> <a class="code" href="pumax_8c.html#ac548e93acae78e8960939467fa588661">Sstripoce</a>[] =
  639. <a name="l00550"></a>00550 {
  640. <a name="l00551"></a>00551 {-99.0, 30.0,<span class="stringliteral">&quot;Black&quot;</span>},
  641. <a name="l00552"></a>00552 { 30.0, 32.0 ,<span class="stringliteral">&quot;RoyalBlue4&quot;</span>},
  642. <a name="l00553"></a>00553 { 32.0 ,32.5,<span class="stringliteral">&quot;RoyalBlue3&quot;</span>},
  643. <a name="l00554"></a>00554 { 32.5, 33.0,<span class="stringliteral">&quot;RoyalBlue2&quot;</span>},
  644. <a name="l00555"></a>00555 { 33.0, 34.0,<span class="stringliteral">&quot;SeaGreen&quot;</span>},
  645. <a name="l00556"></a>00556 { 34.0, 34.5,<span class="stringliteral">&quot;YellowGreen&quot;</span>},
  646. <a name="l00557"></a>00557 { 34.5, 35.0,<span class="stringliteral">&quot;LightGreen&quot;</span>},
  647. <a name="l00558"></a>00558 { 35.0, 35.5,<span class="stringliteral">&quot;Orange&quot;</span>},
  648. <a name="l00559"></a>00559 { 35.5, 36.0,<span class="stringliteral">&quot;DarkOrange&quot;</span>},
  649. <a name="l00560"></a>00560 { 36.0, 36.5,<span class="stringliteral">&quot;OrangeRed&quot;</span>},
  650. <a name="l00561"></a>00561 { 36.5, 40.0,<span class="stringliteral">&quot;red&quot;</span>},
  651. <a name="l00562"></a>00562 { 0.0, 0.0,NULL}
  652. <a name="l00563"></a>00563 };
  653. <a name="l00564"></a>00564
  654. <a name="l00565"></a><a class="code" href="pumax_8c.html#a796ee9592284d3821ad745832918f043">00565</a> <span class="keyword">struct </span><a class="code" href="struct_color_strip.html">ColorStrip</a> <a class="code" href="pumax_8c.html#a796ee9592284d3821ad745832918f043">DCCstrip</a>[] =
  655. <a name="l00566"></a>00566 {
  656. <a name="l00567"></a>00567 {-99.0, 0.0, <span class="stringliteral">&quot;Black&quot;</span>},
  657. <a name="l00568"></a>00568 { 0.0, 10.0,<span class="stringliteral">&quot;Yellow&quot;</span>},
  658. <a name="l00569"></a>00569 { 10.0, 20.0,<span class="stringliteral">&quot;YellowGreen&quot;</span>},
  659. <a name="l00570"></a>00570 { 20.0, 30.0,<span class="stringliteral">&quot;Green&quot;</span>},
  660. <a name="l00571"></a>00571 { 30.0, 40.0,<span class="stringliteral">&quot;Aquamarine&quot;</span>},
  661. <a name="l00572"></a>00572 { 40.0, 50.0,<span class="stringliteral">&quot;Cyan&quot;</span>},
  662. <a name="l00573"></a>00573 { 50.0, 60.0,<span class="stringliteral">&quot;SkyBlue&quot;</span>},
  663. <a name="l00574"></a>00574 { 60.0, 70.0,<span class="stringliteral">&quot;Blue&quot;</span>},
  664. <a name="l00575"></a>00575 { 70.0, 80.0,<span class="stringliteral">&quot;Orchid&quot;</span>},
  665. <a name="l00576"></a>00576 { 80.0, 90.0,<span class="stringliteral">&quot;Magenta&quot;</span>},
  666. <a name="l00577"></a>00577 { 90.0,100.0,<span class="stringliteral">&quot;DarkViolet&quot;</span>},
  667. <a name="l00578"></a>00578 { 0.0, 0.0,NULL}
  668. <a name="l00579"></a>00579 };
  669. <a name="l00580"></a>00580
  670. <a name="l00581"></a><a class="code" href="pumax_8c.html#a2febc58f0aace3cfbc435e59a810f343">00581</a> <span class="keyword">struct </span><a class="code" href="struct_color_strip.html">ColorStrip</a> <a class="code" href="pumax_8c.html#a2febc58f0aace3cfbc435e59a810f343">DTDTstrip</a>[] =
  671. <a name="l00582"></a>00582 {
  672. <a name="l00583"></a>00583 {-99.0, -5.0,<span class="stringliteral">&quot;brown&quot;</span>},
  673. <a name="l00584"></a>00584 {- 5.0, -3.0,<span class="stringliteral">&quot;gold&quot;</span>},
  674. <a name="l00585"></a>00585 { -3.0, -1.5,<span class="stringliteral">&quot;purple&quot;</span>},
  675. <a name="l00586"></a>00586 { -1.5, -0.5,<span class="stringliteral">&quot;red&quot;</span>},
  676. <a name="l00587"></a>00587 { -0.5, -0.25,<span class="stringliteral">&quot;OrangeRed&quot;</span>},
  677. <a name="l00588"></a>00588 { -0.25, 0.0,<span class="stringliteral">&quot;Orange&quot;</span>},
  678. <a name="l00589"></a>00589 { 0.0, 0.25,<span class="stringliteral">&quot;yellow&quot;</span>},
  679. <a name="l00590"></a>00590 { 0.25, 0.5,<span class="stringliteral">&quot;GreenYellow&quot;</span>},
  680. <a name="l00591"></a>00591 { 0.5, 1.5,<span class="stringliteral">&quot;green&quot;</span>},
  681. <a name="l00592"></a>00592 { 1.5, 3.0,<span class="stringliteral">&quot;aquamarine&quot;</span>},
  682. <a name="l00593"></a>00593 { 3.0, 5.0,<span class="stringliteral">&quot;cyan&quot;</span>},
  683. <a name="l00594"></a>00594 { 5.0, 99.0,<span class="stringliteral">&quot;blue&quot;</span>},
  684. <a name="l00595"></a>00595 { 0.0, 0.0,NULL}
  685. <a name="l00596"></a>00596 };
  686. <a name="l00597"></a>00597
  687. <a name="l00598"></a><a class="code" href="pumax_8c.html#a9923377bd967d1dd49eb98f009f48fc2">00598</a> <span class="preprocessor">#define AMPLI_COLS 8</span>
  688. <a name="l00599"></a>00599 <span class="preprocessor"></span>
  689. <a name="l00600"></a><a class="code" href="pumax_8c.html#a941db650b22be955b532e96aec71f302">00600</a> <span class="keyword">struct </span><a class="code" href="struct_color_strip.html">ColorStrip</a> *<a class="code" href="pumax_8c.html#a941db650b22be955b532e96aec71f302">Cstrip</a>;
  690. <a name="l00601"></a><a class="code" href="pumax_8c.html#a957b943624576ae3caec966e58c93bcb">00601</a> <span class="keyword">struct </span><a class="code" href="struct_color_strip.html">ColorStrip</a> *<a class="code" href="pumax_8c.html#a957b943624576ae3caec966e58c93bcb">Pallet</a>[<a class="code" href="pumax_8c.html#afa68e13002f97f4041b7acca426be273">NUMPAL</a>] =
  691. <a name="l00602"></a>00602 { <a class="code" href="pumax_8c.html#a0f1e694b411614c27c69b2b2ac6d293d">Autostrip</a>, <a class="code" href="pumax_8c.html#a27585cbf21e1ba9c7dd6ddc80b53a483">Ustrip</a>, <a class="code" href="pumax_8c.html#af20e4f75be17c991b9279e16d31b2f63">Vstrip</a>, <a class="code" href="pumax_8c.html#a2f27d898c032b44d43e48cbf16abcbc9">Tstrip</a>, <a class="code" href="pumax_8c.html#acb534c740918af3e4435f39fd13430c2">Pstrip</a>, <a class="code" href="pumax_8c.html#a8ca74da35be1e45958cd987830c0ac4a">Qstrip</a>,<a class="code" href="pumax_8c.html#a61c5742f58c9f2060723b084e1b07877">MarsTStrip</a>,<a class="code" href="pumax_8c.html#a8b073841e9a0dd00c1ccefa59fa89ca2">AmpliStrip</a>,
  692. <a name="l00603"></a>00603 <a class="code" href="pumax_8c.html#a72a78f98da890d213dc68dbc61ea6a64">Vegstrip</a>, <a class="code" href="pumax_8c.html#ad8ac7fab8931a9e76a31db92b88002e6">Tstripoce</a>, <a class="code" href="pumax_8c.html#ac548e93acae78e8960939467fa588661">Sstripoce</a>, <a class="code" href="pumax_8c.html#a796ee9592284d3821ad745832918f043">DCCstrip</a>, DTDTstrip};
  693. <a name="l00604"></a>00604
  694. <a name="l00605"></a><a class="code" href="pumax_8c.html#a9cfdd6ecc7e3c280b527a92ac5cd7ca7">00605</a> <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> <a class="code" href="pumax_8c.html#a9cfdd6ecc7e3c280b527a92ac5cd7ca7">VGAX</a>;
  695. <a name="l00606"></a><a class="code" href="pumax_8c.html#ae3ac2c1b41630a01b6493fe81976e943">00606</a> <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> <a class="code" href="pumax_8c.html#ae3ac2c1b41630a01b6493fe81976e943">VGAY</a>;
  696. <a name="l00607"></a><a class="code" href="pumax_8c.html#a4817685b1110531f0435da18eeff0be5">00607</a> <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> <a class="code" href="pumax_8c.html#a4817685b1110531f0435da18eeff0be5">CurVal</a>;
  697. <a name="l00608"></a>00608
  698. <a name="l00609"></a><a class="code" href="pumax_8c.html#a253b4cae7d3fe7a244b1bb3163e268f3">00609</a> <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> *<a class="code" href="pumax_8c.html#a253b4cae7d3fe7a244b1bb3163e268f3">Field</a>; <span class="comment">// Pointer for ISO data</span>
  699. <a name="l00610"></a><a class="code" href="pumax_8c.html#a1d152e4b0e46de1be87e6e9cc20786b8">00610</a> <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> *<a class="code" href="pumax_8c.html#a1d152e4b0e46de1be87e6e9cc20786b8">Ampli</a>; <span class="comment">// Amplitudes of spherical harmonics</span>
  700. <a name="l00611"></a><a class="code" href="pumax_8c.html#a29357c1e810ce4a700215ae4c7d1d32c">00611</a> XColor *<a class="code" href="pumax_8c.html#a29357c1e810ce4a700215ae4c7d1d32c">Acol</a>; <span class="comment">// Amplitude colors</span>
  701. <a name="l00612"></a>00612
  702. <a name="l00613"></a><a class="code" href="pumax_8c.html#af611adb2a277a44b745300318b0bbca7">00613</a> Colormap <a class="code" href="pumax_8c.html#af611adb2a277a44b745300318b0bbca7">colormap</a>;
  703. <a name="l00614"></a>00614
  704. <a name="l00615"></a><a class="code" href="pumax_8c.html#a4cd38c53dcf67c955c7cb4e4d35c0423">00615</a> XColor <a class="code" href="pumax_8c.html#a9977d5ab51b6b525c34f9730753798e0">xcolor1</a>,<a class="code" href="pumax_8c.html#a4cd38c53dcf67c955c7cb4e4d35c0423">xcolor2</a>;
  705. <a name="l00616"></a><a class="code" href="pumax_8c.html#ae93341fafb2771148f17d93c497b3c00">00616</a> XColor <a class="code" href="pumax_8c.html#a01ebcf2a9475e4c321c9a058fe8c543d">Red</a>,<a class="code" href="pumax_8c.html#a5e170cf7540a4c589c138de6a965f05c">Green</a>,<a class="code" href="pumax_8c.html#a54b60e65282d0941b27d3ad598e7ab59">Blue</a>,<a class="code" href="pumax_8c.html#ae93341fafb2771148f17d93c497b3c00">Yellow</a>,<a class="code" href="pumax_8c.html#a800d1cf0ab761999a9e79658b43f172d">Grey</a>,<a class="code" href="pumax_8c.html#a26e22176df9bc06f072235370bf1fcf4">LightRed</a>,<a class="code" href="pumax_8c.html#a8ac22720ee6aa8d3c19cc97378edaefc">DarkRed</a>,<a class="code" href="pumax_8c.html#a6d285575579377fd53ba45ac7626f205">LightBlue</a>,<a class="code" href="pumax_8c.html#a5e2773a5f9e3b633c7042f9df0efa1f6">DarkBlue</a>;
  706. <a name="l00617"></a><a class="code" href="pumax_8c.html#aea97d46f0f314ab5b525ec1fbc9c1def">00617</a> XColor <a class="code" href="pumax_8c.html#aea97d46f0f314ab5b525ec1fbc9c1def">LightGreen</a>,<a class="code" href="pumax_8c.html#ac1bc479b8911f954e0e0b3e1d96a8522">DarkGreen</a>,<a class="code" href="pumax_8c.html#a7895c2ac3b97db386425062372fce47d">Dummy</a>;
  707. <a name="l00618"></a>00618
  708. <a name="l00619"></a><a class="code" href="pumax_8c.html#acf42c004dc25d02b8fbebedd80dc4f2f">00619</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="pumax_8c.html#acf42c004dc25d02b8fbebedd80dc4f2f">TSColor</a>[10];
  709. <a name="l00620"></a>00620
  710. <a name="l00621"></a><a class="code" href="pumax_8c.html#a2669b7d23901c3e648c09854eaf7f76b">00621</a> Window <a class="code" href="pumax_8c.html#a2669b7d23901c3e648c09854eaf7f76b">Win</a>[<a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>];
  711. <a name="l00622"></a><a class="code" href="pumax_8c.html#a7fee7b546595edcbee920757b6309386">00622</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a7fee7b546595edcbee920757b6309386">win</a>; <span class="comment">// Current window</span>
  712. <a name="l00623"></a><a class="code" href="pumax_8c.html#a1e058dabe463a89f604e7f19a4ddf5cd">00623</a> Window <a class="code" href="pumax_8c.html#a1e058dabe463a89f604e7f19a4ddf5cd">Cow</a>; <span class="comment">// Control bar</span>
  713. <a name="l00624"></a><a class="code" href="pumax_8c.html#adf21c8071c5e14213efcbc3d72603d48">00624</a> Window <a class="code" href="pumax_8c.html#adf21c8071c5e14213efcbc3d72603d48">HelpWindow</a>;
  714. <a name="l00625"></a>00625
  715. <a name="l00626"></a><a class="code" href="pumax_8c.html#a830a1a64cb3097b140a98693d01c0405">00626</a> XTextProperty <a class="code" href="pumax_8c.html#a830a1a64cb3097b140a98693d01c0405">WinconName1</a>;
  716. <a name="l00627"></a><a class="code" href="pumax_8c.html#a034886863bf83e00a54498e1d23cb649">00627</a> XTextProperty <a class="code" href="pumax_8c.html#a034886863bf83e00a54498e1d23cb649">WinconName3</a>;
  717. <a name="l00628"></a><a class="code" href="pumax_8c.html#ac5f61b0d40d9b7524a29a685237bc904">00628</a> XTextProperty <a class="code" href="pumax_8c.html#ac5f61b0d40d9b7524a29a685237bc904">WinconPause</a>;
  718. <a name="l00629"></a><a class="code" href="pumax_8c.html#a7cbe9b70caa0883bd8a7484d05b4b424">00629</a> XTextProperty <a class="code" href="pumax_8c.html#a7cbe9b70caa0883bd8a7484d05b4b424">WinconReady</a>;
  719. <a name="l00630"></a><a class="code" href="pumax_8c.html#aea37ddc265c96d0c341776b4698adeda">00630</a> <span class="keywordtype">char</span> *<a class="code" href="pumax_8c.html#aea37ddc265c96d0c341776b4698adeda">PauseTitle</a> = <span class="stringliteral">&quot;Run Paused&quot;</span>;
  720. <a name="l00631"></a><a class="code" href="pumax_8c.html#a686301f669ae0f44f8790dea2fc370e5">00631</a> <span class="keywordtype">char</span> *<a class="code" href="pumax_8c.html#a686301f669ae0f44f8790dea2fc370e5">ReadyTitle</a> = <span class="stringliteral">&quot;Press Start Button&quot;</span>;
  721. <a name="l00632"></a>00632
  722. <a name="l00633"></a><a class="code" href="pumax_8c.html#a8f4018ac7749f8733a95a2e6b6b4b819">00633</a> XEvent <a class="code" href="pumax_8c.html#a8f4018ac7749f8733a95a2e6b6b4b819">CowEvent</a>;
  723. <a name="l00634"></a>00634
  724. <a name="l00635"></a><a class="code" href="pumax_8c.html#a9f8ad3761358fcb0f2e58fc6d01ac74e">00635</a> XSizeHints <a class="code" href="pumax_8c.html#a9f8ad3761358fcb0f2e58fc6d01ac74e">WinSizeHints</a>;
  725. <a name="l00636"></a><a class="code" href="pumax_8c.html#a9a536c9388aa6ac3cbcd5f0e681d9b3c">00636</a> XSizeHints <a class="code" href="pumax_8c.html#a9a536c9388aa6ac3cbcd5f0e681d9b3c">CowSizeHints</a>;
  726. <a name="l00637"></a><a class="code" href="pumax_8c.html#a12d6ffc3e8f2d7e02bbb025dc43fc949">00637</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#aba7235fa49c4a6ebf34f22010faa886b">OutXSize</a>,<a class="code" href="pumax_8c.html#a12d6ffc3e8f2d7e02bbb025dc43fc949">OutYSize</a>;
  727. <a name="l00638"></a><a class="code" href="pumax_8c.html#ad43c3812e6d13e0518d9f8b8f463ffcf">00638</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ad43c3812e6d13e0518d9f8b8f463ffcf">count</a>;
  728. <a name="l00639"></a><a class="code" href="pumax_8c.html#ac73c09c91b4a7000137bd1950f25ece6">00639</a> XEvent <a class="code" href="pumax_8c.html#ac73c09c91b4a7000137bd1950f25ece6">report</a>;
  729. <a name="l00640"></a><a class="code" href="pumax_8c.html#a5da9d24666f1955a9b5ce3d2583b823a">00640</a> GC <a class="code" href="pumax_8c.html#a5da9d24666f1955a9b5ce3d2583b823a">gc</a>;
  730. <a name="l00641"></a>00641
  731. <a name="l00642"></a>00642 <span class="comment">/*</span>
  732. <a name="l00643"></a>00643 <span class="comment">char BigFontName[80] = &quot;10x20&quot;;</span>
  733. <a name="l00644"></a>00644 <span class="comment">char FixFontName[80] = &quot;9x15bold&quot;;</span>
  734. <a name="l00645"></a>00645 <span class="comment">char SubFontName[80] = &quot;6x10&quot;;</span>
  735. <a name="l00646"></a>00646 <span class="comment">*/</span>
  736. <a name="l00647"></a><a class="code" href="pumax_8c.html#ac88f1d4af30c4b80d467b24e0a67d17e">00647</a> <span class="keywordtype">char</span> <a class="code" href="pumax_8c.html#ac88f1d4af30c4b80d467b24e0a67d17e">BigFontName</a>[80] = <span class="stringliteral">&quot;9x15bold&quot;</span>;
  737. <a name="l00648"></a><a class="code" href="pumax_8c.html#a0dfce9f22b144572a07e71ee4120f7a4">00648</a> <span class="keywordtype">char</span> <a class="code" href="pumax_8c.html#a0dfce9f22b144572a07e71ee4120f7a4">FixFontName</a>[80] = <span class="stringliteral">&quot;8x13&quot;</span>;
  738. <a name="l00649"></a><a class="code" href="pumax_8c.html#a8b8af1f04742fe9a27013438a03c83be">00649</a> <span class="keywordtype">char</span> <a class="code" href="pumax_8c.html#a8b8af1f04742fe9a27013438a03c83be">SubFontName</a>[80] = <span class="stringliteral">&quot;6x10&quot;</span>;
  739. <a name="l00650"></a>00650
  740. <a name="l00651"></a><a class="code" href="pumax_8c.html#aa665023c2263df19f760e32916bc9e42">00651</a> XFontStruct *<a class="code" href="pumax_8c.html#aa665023c2263df19f760e32916bc9e42">FixFont</a>;
  741. <a name="l00652"></a><a class="code" href="pumax_8c.html#aeeafbfd2206f5cce04261de84032d7df">00652</a> XFontStruct *<a class="code" href="pumax_8c.html#aeeafbfd2206f5cce04261de84032d7df">SubFont</a>;
  742. <a name="l00653"></a><a class="code" href="pumax_8c.html#a4dcf23c0ccdb238f29350d275a3926b4">00653</a> XFontStruct *<a class="code" href="pumax_8c.html#a4dcf23c0ccdb238f29350d275a3926b4">BigFont</a>;
  743. <a name="l00654"></a><a class="code" href="pumax_8c.html#add5a8c33565a2bbcf55996cccc7a434b">00654</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#add5a8c33565a2bbcf55996cccc7a434b">FixFontHeight</a>;
  744. <a name="l00655"></a><a class="code" href="pumax_8c.html#a3b56ff536f01a928acf89073cf8e0a2f">00655</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a3b56ff536f01a928acf89073cf8e0a2f">SubFontHeight</a>;
  745. <a name="l00656"></a><a class="code" href="pumax_8c.html#a1d2254b4c4eccb72efc38d231910fe68">00656</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a1d2254b4c4eccb72efc38d231910fe68">BigFontHeight</a>;
  746. <a name="l00657"></a><a class="code" href="pumax_8c.html#ae7e27f08b8bcd6f7cf63edc4b0859d7f">00657</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ae7e27f08b8bcd6f7cf63edc4b0859d7f">FixFontWidth</a>;
  747. <a name="l00658"></a><a class="code" href="pumax_8c.html#ad6e35671960b7a01f3afc538555c3443">00658</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ad6e35671960b7a01f3afc538555c3443">SubFontWidth</a>;
  748. <a name="l00659"></a><a class="code" href="pumax_8c.html#aefafab89c009b3e4258f1216ae91e76c">00659</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#aefafab89c009b3e4258f1216ae91e76c">BigFontWidth</a>;
  749. <a name="l00660"></a><a class="code" href="pumax_8c.html#a96ff7ba2422425d32efc6957aa8ff02d">00660</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a96ff7ba2422425d32efc6957aa8ff02d">Paused</a> = 0;
  750. <a name="l00661"></a>00661
  751. <a name="l00662"></a><a class="code" href="pumax_8c.html#a4b3dc854913a2dc6d39a8f54f82a01da">00662</a> <span class="keywordtype">char</span> *<a class="code" href="pumax_8c.html#a4b3dc854913a2dc6d39a8f54f82a01da">display_name</a> = NULL;
  752. <a name="l00663"></a><a class="code" href="pumax_8c.html#ab1d0850a89665ee3f84bc8124f642a2f">00663</a> XWMHints <a class="code" href="pumax_8c.html#ab1d0850a89665ee3f84bc8124f642a2f">wm_hints</a>;
  753. <a name="l00664"></a><a class="code" href="pumax_8c.html#a33c22d728e615ac6724129e7f9e20b65">00664</a> XClassHint <a class="code" href="pumax_8c.html#a33c22d728e615ac6724129e7f9e20b65">class_hints</a>;
  754. <a name="l00665"></a><a class="code" href="pumax_8c.html#a4ab647baec66a74bffd8aa64f3b0559b">00665</a> Atom <a class="code" href="pumax_8c.html#a4ab647baec66a74bffd8aa64f3b0559b">Delwin</a>;
  755. <a name="l00666"></a>00666
  756. <a name="l00667"></a><a class="code" href="pumax_8c.html#ab5d54d649481f4920e248554c9344ee9">00667</a> <span class="keywordtype">char</span> *<a class="code" href="pumax_8c.html#ab5d54d649481f4920e248554c9344ee9">WindowTitle</a>[<a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>];
  757. <a name="l00668"></a><a class="code" href="pumax_8c.html#a3f1a182472dccdeaffafe72909b33d80">00668</a> XTextProperty <a class="code" href="pumax_8c.html#a3f1a182472dccdeaffafe72909b33d80">WindowName</a>[<a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>];
  758. <a name="l00669"></a><a class="code" href="pumax_8c.html#a8aa81ba9770148a0ca89a5262dc62fd4">00669</a> XTextProperty <a class="code" href="pumax_8c.html#a8aa81ba9770148a0ca89a5262dc62fd4">HelpName</a>;
  759. <a name="l00670"></a>00670
  760. <a name="l00671"></a><a class="code" href="pumax_8c.html#abe8f3031f9de5c3b3cc5647e676d5655">00671</a> <span class="keywordtype">char</span> *<a class="code" href="pumax_8c.html#abe8f3031f9de5c3b3cc5647e676d5655">mona</a>[12] =
  761. <a name="l00672"></a>00672 {
  762. <a name="l00673"></a>00673 <span class="stringliteral">&quot;Jan&quot;</span>,<span class="stringliteral">&quot;Feb&quot;</span>,<span class="stringliteral">&quot;Mar&quot;</span>,
  763. <a name="l00674"></a>00674 <span class="stringliteral">&quot;Apr&quot;</span>,<span class="stringliteral">&quot;May&quot;</span>,<span class="stringliteral">&quot;Jun&quot;</span>,
  764. <a name="l00675"></a>00675 <span class="stringliteral">&quot;Jul&quot;</span>,<span class="stringliteral">&quot;Aug&quot;</span>,<span class="stringliteral">&quot;Sep&quot;</span>,
  765. <a name="l00676"></a>00676 <span class="stringliteral">&quot;Oct&quot;</span>,<span class="stringliteral">&quot;Nov&quot;</span>,<span class="stringliteral">&quot;Dec&quot;</span>
  766. <a name="l00677"></a>00677 };
  767. <a name="l00678"></a>00678
  768. <a name="l00679"></a><a class="code" href="pumax_8c.html#aab3181057dc5a08451a3dd3ef3699407">00679</a> <span class="keywordtype">char</span> *<a class="code" href="pumax_8c.html#aab3181057dc5a08451a3dd3ef3699407">wena</a>[7] = {<span class="stringliteral">&quot;Mon&quot;</span>,<span class="stringliteral">&quot;Tue&quot;</span>,<span class="stringliteral">&quot;Wed&quot;</span>,<span class="stringliteral">&quot;Thu&quot;</span>,<span class="stringliteral">&quot;Fri&quot;</span>,<span class="stringliteral">&quot;Sat&quot;</span>,<span class="stringliteral">&quot;Sun&quot;</span>};
  769. <a name="l00680"></a>00680
  770. <a name="l00681"></a><a class="code" href="pumax_8c.html#a3c3df9a533eb74fcdcd614a15a8026dc">00681</a> <span class="keywordtype">char</span> <a class="code" href="pumax_8c.html#a3c3df9a533eb74fcdcd614a15a8026dc">datch</a>[64];
  771. <a name="l00682"></a><a class="code" href="pumax_8c.html#a4168425458c9b1c2863cc90405a1511b">00682</a> <span class="keywordtype">char</span> <a class="code" href="pumax_8c.html#a4168425458c9b1c2863cc90405a1511b">PlanetName</a>[32] = <span class="stringliteral">&quot;Earth&quot;</span>;
  772. <a name="l00683"></a>00683
  773. <a name="l00684"></a><a class="code" href="pumax_8c.html#a1de965a50098fbe98a09aea521c8df59">00684</a> <span class="keywordtype">char</span> <a class="code" href="pumax_8c.html#a1de965a50098fbe98a09aea521c8df59">GUI_default</a>[80] = <span class="stringliteral">&quot;GUI.cfg&quot;</span>;
  774. <a name="l00685"></a><a class="code" href="pumax_8c.html#a6e4709092394d2b39f82b5de515c0aad">00685</a> <span class="keywordtype">char</span> <a class="code" href="pumax_8c.html#a6e4709092394d2b39f82b5de515c0aad">GUI_config</a>[80] = <span class="stringliteral">&quot;GUI_last_used.cfg&quot;</span>;
  775. <a name="l00686"></a>00686
  776. <a name="l00687"></a>00687
  777. <a name="l00688"></a><a class="code" href="pumax_8c.html#ac94f19a0578e5b444225233739749082">00688</a> <span class="preprocessor">#define PSDIM 30</span>
  778. <a name="l00689"></a><a class="code" href="pumax_8c.html#acf637dc464a350b08d37bc9c78040206">00689</a> <span class="preprocessor"></span><span class="keywordtype">char</span> *<a class="code" href="pumax_8c.html#acf637dc464a350b08d37bc9c78040206">pixelstar</a>[<a class="code" href="pumax_8c.html#ac94f19a0578e5b444225233739749082">PSDIM</a>] = {
  779. <a name="l00690"></a>00690 <span class="stringliteral">&quot;..............................&quot;</span>,
  780. <a name="l00691"></a>00691 <span class="stringliteral">&quot;..............................&quot;</span>,
  781. <a name="l00692"></a>00692 <span class="stringliteral">&quot;..............................&quot;</span>,
  782. <a name="l00693"></a>00693 <span class="stringliteral">&quot;...**....**....**....**.......&quot;</span>,
  783. <a name="l00694"></a>00694 <span class="stringliteral">&quot;...**....**....**....**.......&quot;</span>,
  784. <a name="l00695"></a>00695 <span class="stringliteral">&quot;...**....**....**....**.......&quot;</span>,
  785. <a name="l00696"></a>00696 <span class="stringliteral">&quot;...**....**....**....**.......&quot;</span>,
  786. <a name="l00697"></a>00697 <span class="stringliteral">&quot;...**....**************.......&quot;</span>,
  787. <a name="l00698"></a>00698 <span class="stringliteral">&quot;...**....**************.......&quot;</span>,
  788. <a name="l00699"></a>00699 <span class="stringliteral">&quot;...**....**....**....**.......&quot;</span>,
  789. <a name="l00700"></a>00700 <span class="stringliteral">&quot;...***...**....**....**.......&quot;</span>,
  790. <a name="l00701"></a>00701 <span class="stringliteral">&quot;....******.....**....**.......&quot;</span>,
  791. <a name="l00702"></a>00702 <span class="stringliteral">&quot;.....****......**....**.......&quot;</span>,
  792. <a name="l00703"></a>00703 <span class="stringliteral">&quot;..............................&quot;</span>,
  793. <a name="l00704"></a>00704 <span class="stringliteral">&quot;..............................&quot;</span>,
  794. <a name="l00705"></a>00705 <span class="stringliteral">&quot;..............................&quot;</span>,
  795. <a name="l00706"></a>00706 <span class="stringliteral">&quot;..............................&quot;</span>,
  796. <a name="l00707"></a>00707 <span class="stringliteral">&quot;..............................&quot;</span>,
  797. <a name="l00708"></a>00708 <span class="stringliteral">&quot;..............................&quot;</span>,
  798. <a name="l00709"></a>00709 <span class="stringliteral">&quot;..............................&quot;</span>,
  799. <a name="l00710"></a>00710 <span class="stringliteral">&quot;..............................&quot;</span>,
  800. <a name="l00711"></a>00711 <span class="stringliteral">&quot;..............................&quot;</span>,
  801. <a name="l00712"></a>00712 <span class="stringliteral">&quot;.......................*......&quot;</span>,
  802. <a name="l00713"></a>00713 <span class="stringliteral">&quot;......................***.....&quot;</span>,
  803. <a name="l00714"></a>00714 <span class="stringliteral">&quot;...................**.***.**..&quot;</span>,
  804. <a name="l00715"></a>00715 <span class="stringliteral">&quot;...................**.***.**..&quot;</span>,
  805. <a name="l00716"></a>00716 <span class="stringliteral">&quot;...................**.***.**..&quot;</span>,
  806. <a name="l00717"></a>00717 <span class="stringliteral">&quot;...................****.****..&quot;</span>,
  807. <a name="l00718"></a>00718 <span class="stringliteral">&quot;...................***...***..&quot;</span>,
  808. <a name="l00719"></a>00719 <span class="stringliteral">&quot;...................***...***..&quot;</span>};
  809. <a name="l00720"></a>00720
  810. <a name="l00721"></a>00721 <span class="comment">// Variables used for calculating &quot;frames per second&quot;</span>
  811. <a name="l00722"></a>00722
  812. <a name="l00723"></a><a class="code" href="pumax_8c.html#a45b67662d620a977a2cfe519f7ab6273">00723</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a45b67662d620a977a2cfe519f7ab6273">fps</a>;
  813. <a name="l00724"></a><a class="code" href="pumax_8c.html#abbe54d9d31d45c4bf9b3881ab71b3d9d">00724</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#abbe54d9d31d45c4bf9b3881ab71b3d9d">rmuf</a> = 20; <span class="comment">// Rotating map update frequency [1/sec]</span>
  814. <a name="l00725"></a><a class="code" href="pumax_8c.html#ae0249a8c73326c7982678429005c059d">00725</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ae0249a8c73326c7982678429005c059d">rmui</a> = 1; <span class="comment">// Rotating map update interval [steps]</span>
  815. <a name="l00726"></a><a class="code" href="pumax_8c.html#a156205cf644829d37762ef72e26f2bd8">00726</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a156205cf644829d37762ef72e26f2bd8">SkipFreq</a>;
  816. <a name="l00727"></a><a class="code" href="pumax_8c.html#af22e8278c499183a077f11d9f2aa1922">00727</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#af22e8278c499183a077f11d9f2aa1922">ThisSecond</a>;
  817. <a name="l00728"></a><a class="code" href="pumax_8c.html#a959fb7a5f8194231fd7d9c9255dd8176">00728</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a959fb7a5f8194231fd7d9c9255dd8176">LastSecond</a>;
  818. <a name="l00729"></a><a class="code" href="pumax_8c.html#af0d7de5b658838770aedc6e81c2bfbba">00729</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#af0d7de5b658838770aedc6e81c2bfbba">LastStep</a>;
  819. <a name="l00730"></a><a class="code" href="pumax_8c.html#a0358d36d86cd182699f08224c9f61aec">00730</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a0358d36d86cd182699f08224c9f61aec">SecEvent</a>;
  820. <a name="l00731"></a>00731
  821. <a name="l00732"></a><a class="code" href="pumax_8c.html#a5d9c6d601c3a2a89c6397da97ae235ff">00732</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a5d9c6d601c3a2a89c6397da97ae235ff">ndatim</a>[6]; <span class="comment">/* year, month, day, hour, minute, weekday */</span>
  822. <a name="l00733"></a><a class="code" href="pumax_8c.html#a431f109cd0fda419267defc94d5e4926">00733</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a431f109cd0fda419267defc94d5e4926">LastMinute</a>; <span class="comment">/* Last value of ndatim(4) */</span>
  823. <a name="l00734"></a><a class="code" href="pumax_8c.html#aa82f23779010beeff2184e4bd6aa1881">00734</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#aa82f23779010beeff2184e4bd6aa1881">DeltaTime</a> ; <span class="comment">/* Computed timestep interval [min] */</span>
  824. <a name="l00735"></a>00735
  825. <a name="l00736"></a><a class="code" href="struct_b_m_istruct.html">00736</a> <span class="keyword">struct </span><a class="code" href="struct_b_m_istruct.html">BMIstruct</a>
  826. <a name="l00737"></a>00737 {
  827. <a name="l00738"></a><a class="code" href="struct_b_m_istruct.html#acfe239d5fa92bc82701fafaf72efcacf">00738</a> <span class="keywordtype">int</span> <a class="code" href="struct_b_m_istruct.html#acfe239d5fa92bc82701fafaf72efcacf">Size</a>;
  828. <a name="l00739"></a><a class="code" href="struct_b_m_istruct.html#a6486fcb19864264947f29b30c5a1d6e9">00739</a> <span class="keywordtype">int</span> <a class="code" href="struct_b_m_istruct.html#a6486fcb19864264947f29b30c5a1d6e9">Width</a>;
  829. <a name="l00740"></a><a class="code" href="struct_b_m_istruct.html#a52746e7d2f7de61866c6a2217083d1a5">00740</a> <span class="keywordtype">int</span> <a class="code" href="struct_b_m_istruct.html#a52746e7d2f7de61866c6a2217083d1a5">Height</a>;
  830. <a name="l00741"></a><a class="code" href="struct_b_m_istruct.html#a29b39d5bd71bb03b8b09b0de1a4b9c8d">00741</a> <span class="keywordtype">short</span> <a class="code" href="struct_b_m_istruct.html#a29b39d5bd71bb03b8b09b0de1a4b9c8d">Planes</a>;
  831. <a name="l00742"></a><a class="code" href="struct_b_m_istruct.html#a116a68a16b53430a1a9f0bdf657e53c8">00742</a> <span class="keywordtype">short</span> <a class="code" href="struct_b_m_istruct.html#a116a68a16b53430a1a9f0bdf657e53c8">Count</a>;
  832. <a name="l00743"></a><a class="code" href="struct_b_m_istruct.html#a28c320842950835ff4de540ed4c4b4fd">00743</a> <span class="keywordtype">int</span> <a class="code" href="struct_b_m_istruct.html#a28c320842950835ff4de540ed4c4b4fd">Compression</a>;
  833. <a name="l00744"></a><a class="code" href="struct_b_m_istruct.html#a11df57e6d765d04cd654eb68e9ed5606">00744</a> <span class="keywordtype">int</span> <a class="code" href="struct_b_m_istruct.html#a11df57e6d765d04cd654eb68e9ed5606">SizeImage</a>;
  834. <a name="l00745"></a><a class="code" href="struct_b_m_istruct.html#ad14c3cac819fdb1563374c2ef4913aac">00745</a> <span class="keywordtype">int</span> <a class="code" href="struct_b_m_istruct.html#ad14c3cac819fdb1563374c2ef4913aac">XPelsPerMeter</a>;
  835. <a name="l00746"></a><a class="code" href="struct_b_m_istruct.html#a0eae4b963d52b8a8eb15fc6275f8b481">00746</a> <span class="keywordtype">int</span> <a class="code" href="struct_b_m_istruct.html#a0eae4b963d52b8a8eb15fc6275f8b481">YPelsPerMeter</a>;
  836. <a name="l00747"></a><a class="code" href="struct_b_m_istruct.html#a8f8f9ef7e30ba0653ba479b28676c3ce">00747</a> <span class="keywordtype">int</span> <a class="code" href="struct_b_m_istruct.html#a8f8f9ef7e30ba0653ba479b28676c3ce">ClrUsed</a>;
  837. <a name="l00748"></a><a class="code" href="struct_b_m_istruct.html#a357dc62501d321ff870187909c3c4b5f">00748</a> <span class="keywordtype">int</span> <a class="code" href="struct_b_m_istruct.html#a357dc62501d321ff870187909c3c4b5f">ClrImportant</a>;
  838. <a name="l00749"></a>00749 };
  839. <a name="l00750"></a>00750
  840. <a name="l00751"></a><a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">00751</a> <span class="keyword">struct </span><a class="code" href="struct_b_m_istruct.html">BMIstruct</a> <a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>;
  841. <a name="l00752"></a>00752
  842. <a name="l00753"></a><a class="code" href="struct_map_image_struct.html">00753</a> <span class="keyword">struct </span><a class="code" href="struct_map_image_struct.html">MapImageStruct</a>
  843. <a name="l00754"></a>00754 {
  844. <a name="l00755"></a><a class="code" href="struct_map_image_struct.html#aef0d9e2ef28e765f15559ff077d9fe26">00755</a> <span class="keywordtype">char</span> *<a class="code" href="struct_map_image_struct.html#aef0d9e2ef28e765f15559ff077d9fe26">d</a>; <span class="comment">// Bitmap data</span>
  845. <a name="l00756"></a><a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">00756</a> <span class="keywordtype">int</span> <a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>; <span class="comment">// Image width</span>
  846. <a name="l00757"></a><a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">00757</a> <span class="keywordtype">int</span> <a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a>; <span class="comment">// Image height</span>
  847. <a name="l00758"></a><a class="code" href="struct_map_image_struct.html#a7c3018a3883c438e08c5632a49e39c66">00758</a> <span class="keywordtype">int</span> <a class="code" href="struct_map_image_struct.html#a7c3018a3883c438e08c5632a49e39c66">f</a>; <span class="comment">// Rotation factor</span>
  848. <a name="l00759"></a><a class="code" href="struct_map_image_struct.html#a46fe3297a24177fa1aef6e5cf19a4b4b">00759</a> <span class="keywordtype">float</span> <a class="code" href="struct_map_image_struct.html#a46fe3297a24177fa1aef6e5cf19a4b4b">l</a>; <span class="comment">// Reference longitude</span>
  849. <a name="l00760"></a><a class="code" href="struct_map_image_struct.html#a0c135dc0852d411fd87b7ac84ba55664">00760</a> <span class="keywordtype">float</span> <a class="code" href="struct_map_image_struct.html#a0c135dc0852d411fd87b7ac84ba55664">r</a>; <span class="comment">// Rotation speed [deg/step]</span>
  850. <a name="l00761"></a><a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">00761</a> XImage *<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a>; <span class="comment">// XImage structure</span>
  851. <a name="l00762"></a>00762 };
  852. <a name="l00763"></a>00763
  853. <a name="l00764"></a>00764 <span class="comment">// Convert an RGB value to an X11 Pixel</span>
  854. <a name="l00765"></a>00765
  855. <a name="l00766"></a><a class="code" href="pumax_8c.html#a6abc2b45ddd56d2171e775e89537fc04">00766</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="pumax_8c.html#a6abc2b45ddd56d2171e775e89537fc04">create_pixel</a>(<span class="keywordtype">long</span> red, <span class="keywordtype">long</span> green, <span class="keywordtype">long</span> blue)
  856. <a name="l00767"></a>00767 {
  857. <a name="l00768"></a>00768 <span class="keywordflow">if</span> (ScreenD == 24) <span class="comment">// 24 bit true color</span>
  858. <a name="l00769"></a>00769 {
  859. <a name="l00770"></a>00770 <span class="keywordflow">return</span> red | green &lt;&lt; 8 | blue &lt;&lt; 16;
  860. <a name="l00771"></a>00771 }
  861. <a name="l00772"></a>00772 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ScreenD == 16) <span class="comment">// 16 bit RGB 565</span>
  862. <a name="l00773"></a>00773 {
  863. <a name="l00774"></a>00774 <span class="keywordflow">return</span> red &gt;&gt; 3 | (green &gt;&gt; 2) &lt;&lt; 5 | (blue &gt;&gt; 3) &lt;&lt; 11;
  864. <a name="l00775"></a>00775 }
  865. <a name="l00776"></a>00776 <span class="keywordflow">else</span> <span class="keywordflow">return</span> 0;
  866. <a name="l00777"></a>00777 }
  867. <a name="l00778"></a>00778
  868. <a name="l00779"></a><a class="code" href="pumax_8c.html#a0aac8b0778521c19e621a6b60b3e1a4b">00779</a> <span class="keyword">struct </span><a class="code" href="struct_map_image_struct.html">MapImageStruct</a> <a class="code" href="pumax_8c.html#a0aac8b0778521c19e621a6b60b3e1a4b">MapHR</a>; <span class="comment">// Hires (2560x1280) Earth image</span>
  869. <a name="l00780"></a><a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">00780</a> <span class="keyword">struct </span><a class="code" href="struct_map_image_struct.html">MapImageStruct</a> <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[<a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>];
  870. <a name="l00781"></a>00781
  871. <a name="l00782"></a><a class="code" href="pumax_8c.html#a662cbf19367e08f6e376f8d1e3b765e0">00782</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a662cbf19367e08f6e376f8d1e3b765e0">ScaleImage</a>(<span class="keyword">struct</span> <a class="code" href="struct_map_image_struct.html">MapImageStruct</a> *s, <span class="keyword">struct</span> <a class="code" href="struct_map_image_struct.html">MapImageStruct</a> *<a class="code" href="struct_map_image_struct.html#aef0d9e2ef28e765f15559ff077d9fe26">d</a>)
  872. <a name="l00783"></a>00783 {
  873. <a name="l00784"></a>00784 <span class="keywordtype">int</span> a,b,x,y;
  874. <a name="l00785"></a>00785 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> px;
  875. <a name="l00786"></a>00786 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a>,<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>;
  876. <a name="l00787"></a>00787 <span class="keywordtype">double</span> <a class="code" href="struct_map_image_struct.html#a7c3018a3883c438e08c5632a49e39c66">f</a>,g;
  877. <a name="l00788"></a>00788
  878. <a name="l00789"></a>00789 <span class="keywordflow">if</span> (d-&gt;<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a>) XDestroyImage(d-&gt;<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a>);
  879. <a name="l00790"></a>00790 w = (d-&gt;<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a> + 7) &amp; 0xFFF8;
  880. <a name="l00791"></a>00791 h = d-&gt;<a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a>;
  881. <a name="l00792"></a>00792 d-&gt;<a class="code" href="struct_map_image_struct.html#aef0d9e2ef28e765f15559ff077d9fe26">d</a> = malloc(4 * w * h);
  882. <a name="l00793"></a>00793 d-&gt;<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a> = XCreateImage(display,CopyFromParent,ScreenD,ZPixmap,0,
  883. <a name="l00794"></a>00794 d-&gt;<a class="code" href="struct_map_image_struct.html#aef0d9e2ef28e765f15559ff077d9fe26">d</a>,w,h,8,0);
  884. <a name="l00795"></a>00795
  885. <a name="l00796"></a>00796 f = (double)s-&gt;<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a> / (<span class="keywordtype">double</span>)d-&gt;<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>;
  886. <a name="l00797"></a>00797 g = (double)s-&gt;<a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a> / (<span class="keywordtype">double</span>)d-&gt;<a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a>;
  887. <a name="l00798"></a>00798
  888. <a name="l00799"></a>00799 <span class="keywordflow">for</span> (y = 0 ; y &lt; d-&gt;<a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a> ; ++y)
  889. <a name="l00800"></a>00800 <span class="keywordflow">for</span> (x = 0 ; x &lt; d-&gt;<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a> ; ++x)
  890. <a name="l00801"></a>00801 {
  891. <a name="l00802"></a>00802 a = x * <a class="code" href="struct_map_image_struct.html#a7c3018a3883c438e08c5632a49e39c66">f</a>;
  892. <a name="l00803"></a>00803 b = y * g;
  893. <a name="l00804"></a>00804 XPutPixel(d-&gt;<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a>,x,y,XGetPixel(s-&gt;<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a>,a,b));
  894. <a name="l00805"></a>00805 }
  895. <a name="l00806"></a>00806 }
  896. <a name="l00807"></a>00807
  897. <a name="l00808"></a>00808
  898. <a name="l00809"></a><a class="code" href="pumax_8c.html#a2a67fb15956dca4db41c85496c11240e">00809</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a2a67fb15956dca4db41c85496c11240e">PolarImage</a>(<span class="keyword">struct</span> <a class="code" href="struct_map_image_struct.html">MapImageStruct</a> *s, <span class="keyword">struct</span> <a class="code" href="struct_map_image_struct.html">MapImageStruct</a> *<a class="code" href="struct_map_image_struct.html#aef0d9e2ef28e765f15559ff077d9fe26">d</a>)
  899. <a name="l00810"></a>00810 {
  900. <a name="l00811"></a>00811 <span class="keywordtype">int</span> a,b,x,y;
  901. <a name="l00812"></a>00812 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a>,<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>;
  902. <a name="l00813"></a>00813 <span class="keywordtype">double</span> <a class="code" href="struct_map_image_struct.html#a7c3018a3883c438e08c5632a49e39c66">f</a>,lfa,xnp,ynp,xsp,ysp,dx,dy;
  903. <a name="l00814"></a>00814
  904. <a name="l00815"></a>00815 <span class="keywordflow">if</span> (d-&gt;<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a>) XDestroyImage(d-&gt;<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a>);
  905. <a name="l00816"></a>00816 w = (d-&gt;<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a> + 7) &amp; 0xFFF8;
  906. <a name="l00817"></a>00817 h = d-&gt;<a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a>;
  907. <a name="l00818"></a>00818 d-&gt;<a class="code" href="struct_map_image_struct.html#aef0d9e2ef28e765f15559ff077d9fe26">d</a> = malloc(4 * w * h);
  908. <a name="l00819"></a>00819 d-&gt;<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a> = XCreateImage(display,CopyFromParent,ScreenD,ZPixmap,0,
  909. <a name="l00820"></a>00820 d-&gt;<a class="code" href="struct_map_image_struct.html#aef0d9e2ef28e765f15559ff077d9fe26">d</a>,w,h,8,0);
  910. <a name="l00821"></a>00821
  911. <a name="l00822"></a>00822 f = (double)s-&gt;<a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a> / (<span class="keywordtype">double</span>)d-&gt;<a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a>;
  912. <a name="l00823"></a>00823 lfa = (s-&gt;<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>-1) / (2.0 * M_PI);
  913. <a name="l00824"></a>00824 xnp = (d-&gt;<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>) * 0.25;
  914. <a name="l00825"></a>00825 ynp = (d-&gt;<a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a>) * 0.50;
  915. <a name="l00826"></a>00826 xsp = (d-&gt;<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>) * 0.75;
  916. <a name="l00827"></a>00827 ysp = ynp;
  917. <a name="l00828"></a>00828
  918. <a name="l00829"></a>00829 <span class="keywordflow">for</span> (y = 0 ; y &lt; d-&gt;<a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a> ; ++y)
  919. <a name="l00830"></a>00830 {
  920. <a name="l00831"></a>00831 dy = ynp - y;
  921. <a name="l00832"></a>00832 <span class="keywordflow">for</span> (x = 0 ; x &lt; d-&gt;<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>/2 ; ++x) <span class="comment">/* Northern hemisphere */</span>
  922. <a name="l00833"></a>00833 {
  923. <a name="l00834"></a>00834 dx = xnp - x;
  924. <a name="l00835"></a>00835 a = atan2(dx,dy) * lfa;
  925. <a name="l00836"></a>00836 b = sqrt(dx * dx + dy * dy) * <a class="code" href="struct_map_image_struct.html#a7c3018a3883c438e08c5632a49e39c66">f</a>;
  926. <a name="l00837"></a>00837 <span class="keywordflow">if</span> (a &lt; 0.0) a += (s-&gt;<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>);
  927. <a name="l00838"></a>00838 <span class="keywordflow">if</span> (a &gt;= 0 &amp;&amp; a &lt; s-&gt;w &amp;&amp; b &gt;= 0 &amp;&amp; b &lt;= s-&gt;h/2)
  928. <a name="l00839"></a>00839 XPutPixel(d-&gt;<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a>,x,y,XGetPixel(s-&gt;<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a>,a,b));
  929. <a name="l00840"></a>00840 <span class="keywordflow">else</span> XPutPixel(d-&gt;<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a>,x,y,BlackPix);
  930. <a name="l00841"></a>00841 }
  931. <a name="l00842"></a>00842 dy = ysp - y;
  932. <a name="l00843"></a>00843 <span class="keywordflow">for</span> (x = d-&gt;<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>/2 ; x &lt; d-&gt;w ; ++x) <span class="comment">/* Southern hemisphere */</span>
  933. <a name="l00844"></a>00844 {
  934. <a name="l00845"></a>00845 dx = x - xsp;
  935. <a name="l00846"></a>00846 a = atan2(dx,dy) * lfa;
  936. <a name="l00847"></a>00847 b = s-&gt;<a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a> - f * sqrt(dx * dx + dy * dy);
  937. <a name="l00848"></a>00848 <span class="keywordflow">if</span> (a &lt; 0.0) a += (s-&gt;<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>);
  938. <a name="l00849"></a>00849 <span class="keywordflow">if</span> (a &gt;= 0 &amp;&amp; a &lt; s-&gt;w &amp;&amp; b &gt;= 0 &amp;&amp; b &gt;= s-&gt;<a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a>/2 &amp;&amp; b &lt;= s-&gt;h)
  939. <a name="l00850"></a>00850 XPutPixel(d-&gt;<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a>,x,y,XGetPixel(s-&gt;<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a>,a,b));
  940. <a name="l00851"></a>00851 <span class="keywordflow">else</span> XPutPixel(d-&gt;<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a>,x,y,BlackPix);
  941. <a name="l00852"></a>00852 }
  942. <a name="l00853"></a>00853 }
  943. <a name="l00854"></a>00854 }
  944. <a name="l00855"></a>00855
  945. <a name="l00856"></a>00856
  946. <a name="l00857"></a><a class="code" href="pumax_8c.html#a13fe574b091b3f6d1d2397d51a209cef">00857</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a13fe574b091b3f6d1d2397d51a209cef">RevOrtho</a>(<span class="keywordtype">double</span> R, <span class="keywordtype">double</span> lam0, <span class="keywordtype">double</span> phi0, <span class="keywordtype">int</span> xx, <span class="keywordtype">int</span> yy, <span class="keywordtype">double</span> *lam, <span class="keywordtype">double</span> *phi)
  947. <a name="l00858"></a>00858 {
  948. <a name="l00859"></a>00859 <span class="keywordtype">double</span> rho,c,rhoq,x,y;
  949. <a name="l00860"></a>00860
  950. <a name="l00861"></a>00861 x = xx;
  951. <a name="l00862"></a>00862 y = yy;
  952. <a name="l00863"></a>00863
  953. <a name="l00864"></a>00864 rhoq = x*x + y*y;
  954. <a name="l00865"></a>00865 rho = sqrt(rhoq);
  955. <a name="l00866"></a>00866 <span class="keywordflow">if</span> (rho &gt; R)
  956. <a name="l00867"></a>00867 {
  957. <a name="l00868"></a>00868 *phi = 999.9;
  958. <a name="l00869"></a>00869 *lam = 999.9;
  959. <a name="l00870"></a>00870 }
  960. <a name="l00871"></a>00871 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (rho &gt; R / 100000.0)
  961. <a name="l00872"></a>00872 {
  962. <a name="l00873"></a>00873 c = asin(rho / R);
  963. <a name="l00874"></a>00874 *phi = asin(cos(c) * sin(phi0) + y * sin(c) * cos(phi0) / rho);
  964. <a name="l00875"></a>00875 *lam = lam0 + atan2(x * sin(c) , rho * cos(phi0) * cos(c) - y * sin(phi0) * sin(c));
  965. <a name="l00876"></a>00876 }
  966. <a name="l00877"></a>00877 <span class="keywordflow">else</span>
  967. <a name="l00878"></a>00878 {
  968. <a name="l00879"></a>00879 *phi = phi0;
  969. <a name="l00880"></a>00880 *lam = lam0;
  970. <a name="l00881"></a>00881 }
  971. <a name="l00882"></a>00882 <span class="comment">// printf(&quot;[%6.1lf / %6.1lf] --&gt; (%6.1lf / %6.1lf)\n&quot;,x,y,*lam,*phi);</span>
  972. <a name="l00883"></a>00883 }
  973. <a name="l00884"></a>00884
  974. <a name="l00885"></a>00885 <span class="comment">/* ==================================================== */</span>
  975. <a name="l00886"></a>00886 <span class="comment">/* AzimuthalImage - Display map in azimuthal projection */</span>
  976. <a name="l00887"></a>00887 <span class="comment">/* ==================================================== */</span>
  977. <a name="l00888"></a>00888
  978. <a name="l00889"></a><a class="code" href="pumax_8c.html#ad027458730957d93b4a352feed5ea06d">00889</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#ad027458730957d93b4a352feed5ea06d">AzimuthalImage</a>(<span class="keyword">struct</span> <a class="code" href="struct_map_image_struct.html">MapImageStruct</a> *s, <span class="keyword">struct</span> <a class="code" href="struct_map_image_struct.html">MapImageStruct</a> *<a class="code" href="struct_map_image_struct.html#aef0d9e2ef28e765f15559ff077d9fe26">d</a>)
  979. <a name="l00890"></a>00890 {
  980. <a name="l00891"></a>00891 <span class="keywordtype">int</span> lam; <span class="comment">// lambda pixel coordinate in source image</span>
  981. <a name="l00892"></a>00892 <span class="keywordtype">int</span> phi; <span class="comment">// phi pixel coordinate in source image</span>
  982. <a name="l00893"></a>00893 <span class="keywordtype">int</span> x ; <span class="comment">// x pixel coordinate in destination image</span>
  983. <a name="l00894"></a>00894 <span class="keywordtype">int</span> y ; <span class="comment">// y pixel coordinate in destination image</span>
  984. <a name="l00895"></a>00895 <span class="keywordtype">int</span> dxc; <span class="comment">// pixel coordinate of centre position</span>
  985. <a name="l00896"></a>00896 <span class="keywordtype">int</span> dxl; <span class="comment">// pixel coordinate of left most position</span>
  986. <a name="l00897"></a>00897 <span class="keywordtype">int</span> dxr; <span class="comment">// pixel coordinate of right most position</span>
  987. <a name="l00898"></a>00898 <span class="keywordtype">int</span> dx ; <span class="comment">// centre relative x position</span>
  988. <a name="l00899"></a>00899 <span class="keywordtype">int</span> dy ; <span class="comment">// centre relative y position</span>
  989. <a name="l00900"></a>00900 <span class="keywordtype">int</span> p00; <span class="comment">// euqator</span>
  990. <a name="l00901"></a>00901 <span class="keywordtype">int</span> l00; <span class="comment">// reference longitude</span>
  991. <a name="l00902"></a>00902
  992. <a name="l00903"></a>00903 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dih; <span class="comment">// destination image height</span>
  993. <a name="l00904"></a>00904 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> diw; <span class="comment">// destination image width</span>
  994. <a name="l00905"></a>00905 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dpw; <span class="comment">// destination image padded width</span>
  995. <a name="l00906"></a>00906
  996. <a name="l00907"></a>00907 <span class="keywordtype">double</span> rad; <span class="comment">// pixel radius of new image</span>
  997. <a name="l00908"></a>00908 <span class="keywordtype">double</span> ysc; <span class="comment">// yscale = source height / destination height</span>
  998. <a name="l00909"></a>00909 <span class="keywordtype">double</span> rho; <span class="comment">// distance from centre</span>
  999. <a name="l00910"></a>00910 <span class="keywordtype">double</span> xpi; <span class="comment">// x scale factor = 2 * PI / width</span>
  1000. <a name="l00911"></a>00911 <span class="keywordtype">double</span> ypi; <span class="comment">// y scale factor = PI / height</span>
  1001. <a name="l00912"></a>00912 <span class="keywordtype">double</span> xrf;
  1002. <a name="l00913"></a>00913 <span class="keywordtype">double</span> yrf;
  1003. <a name="l00914"></a>00914
  1004. <a name="l00915"></a>00915 XImage *sX; <span class="comment">// source image</span>
  1005. <a name="l00916"></a>00916 XImage *dX; <span class="comment">// destination image</span>
  1006. <a name="l00917"></a>00917
  1007. <a name="l00918"></a>00918
  1008. <a name="l00919"></a>00919 <span class="comment">// Destroy old image structure inclusive data storage</span>
  1009. <a name="l00920"></a>00920
  1010. <a name="l00921"></a>00921 <span class="keywordflow">if</span> (d-&gt;<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a>) XDestroyImage(d-&gt;<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a>);
  1011. <a name="l00922"></a>00922
  1012. <a name="l00923"></a>00923 <span class="comment">// Set width of new image</span>
  1013. <a name="l00924"></a>00924
  1014. <a name="l00925"></a>00925 diw = d-&gt;<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>;
  1015. <a name="l00926"></a>00926
  1016. <a name="l00927"></a>00927 <span class="comment">// Pad width of new image to a multiple of 8</span>
  1017. <a name="l00928"></a>00928
  1018. <a name="l00929"></a>00929 dpw = (diw + 7) &amp; 0xFFF8;
  1019. <a name="l00930"></a>00930
  1020. <a name="l00931"></a>00931 <span class="comment">// Set height of new image</span>
  1021. <a name="l00932"></a>00932
  1022. <a name="l00933"></a>00933 dih = d-&gt;<a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a>;
  1023. <a name="l00934"></a>00934
  1024. <a name="l00935"></a>00935 <span class="comment">// Allocate space for image data</span>
  1025. <a name="l00936"></a>00936
  1026. <a name="l00937"></a>00937 d-&gt;<a class="code" href="struct_map_image_struct.html#aef0d9e2ef28e765f15559ff077d9fe26">d</a> = calloc(dpw * dih,4);
  1027. <a name="l00938"></a>00938
  1028. <a name="l00939"></a>00939 <span class="comment">// Create image structure</span>
  1029. <a name="l00940"></a>00940
  1030. <a name="l00941"></a>00941 dX = d-&gt;<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a> = XCreateImage(display,CopyFromParent,ScreenD,ZPixmap,0,d-&gt;<a class="code" href="struct_map_image_struct.html#aef0d9e2ef28e765f15559ff077d9fe26">d</a>,dpw,dih,8,0);
  1031. <a name="l00942"></a>00942 sX = s-&gt;<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a>;
  1032. <a name="l00943"></a>00943
  1033. <a name="l00944"></a>00944 p00 = s-&gt;<a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a> &gt;&gt; 1;
  1034. <a name="l00945"></a>00945 rad = dih &gt;&gt; 1;
  1035. <a name="l00946"></a>00946 dxc = diw &gt;&gt; 1;
  1036. <a name="l00947"></a>00947 dxl = <a class="code" href="pumax_8c.html#afa99ec4acc4ecb2dc3c2d05da15d0e3f">MAX</a>(dxc - rad, 0);
  1037. <a name="l00948"></a>00948 dxr = <a class="code" href="pumax_8c.html#a3acffbd305ee72dcd4593c0d8af64a4f">MIN</a>(dxc + rad, diw);
  1038. <a name="l00949"></a>00949 xpi = s-&gt;<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a> / M_PI * 0.5;
  1039. <a name="l00950"></a>00950 ypi = s-&gt;<a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a> / M_PI;
  1040. <a name="l00951"></a>00951 ysc = (double)s-&gt;<a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a> / (<span class="keywordtype">double</span>)dih;
  1041. <a name="l00952"></a>00952 l00 = (int)((d-&gt;<a class="code" href="struct_map_image_struct.html#a46fe3297a24177fa1aef6e5cf19a4b4b">l</a> * s-&gt;<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>) / 360 + s-&gt;<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>/2) % s-&gt;<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>;
  1042. <a name="l00953"></a>00953 xrf = (<span class="keywordtype">double</span>)diw / pow(2.0,31),
  1043. <a name="l00954"></a>00954 yrf = (double)dih / pow(2.0,31);
  1044. <a name="l00955"></a>00955
  1045. <a name="l00956"></a>00956 <span class="comment">// Paint some stars on the sky</span>
  1046. <a name="l00957"></a>00957
  1047. <a name="l00958"></a>00958 srandom(Seed);
  1048. <a name="l00959"></a>00959 <span class="keywordflow">for</span> (y = 0 ; y &lt; (diw * dih) &gt;&gt; 8 ; ++y)
  1049. <a name="l00960"></a>00960 XPutPixel(dX,xrf*random(),yrf*random(),WhitePix);
  1050. <a name="l00961"></a>00961
  1051. <a name="l00962"></a>00962 <span class="keywordflow">for</span> (y = 0 ; y &lt; dih ; ++y)
  1052. <a name="l00963"></a>00963 {
  1053. <a name="l00964"></a>00964 dy = y - rad;
  1054. <a name="l00965"></a>00965 phi = y * ysc;
  1055. <a name="l00966"></a>00966 <span class="keywordflow">for</span> (x = dxl ; x &lt; dxr ; ++x)
  1056. <a name="l00967"></a>00967 {
  1057. <a name="l00968"></a>00968 dx = x - dxc;
  1058. <a name="l00969"></a>00969 rho = sqrt(dx * dx + dy * dy);
  1059. <a name="l00970"></a>00970 <span class="keywordflow">if</span> (rho &lt; rad)
  1060. <a name="l00971"></a>00971 {
  1061. <a name="l00972"></a>00972 lam = l00 + xpi * atan2(dx / rad, cos(asin(rho / rad)));
  1062. <a name="l00973"></a>00973 phi = p00 + ypi * asin(dy / rad);
  1063. <a name="l00974"></a>00974 XPutPixel(dX,x,y,XGetPixel(sX,lam,phi));
  1064. <a name="l00975"></a>00975 }
  1065. <a name="l00976"></a>00976 }
  1066. <a name="l00977"></a>00977 }
  1067. <a name="l00978"></a>00978 }
  1068. <a name="l00979"></a>00979
  1069. <a name="l00980"></a>00980
  1070. <a name="l00981"></a><a class="code" href="pumax_8c.html#ac8dc7ad258c2b3a3f4a3780db763bad7">00981</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#ac8dc7ad258c2b3a3f4a3780db763bad7">SwapIEEE16</a>(<span class="keywordtype">char</span> W[2])
  1071. <a name="l00982"></a>00982 {
  1072. <a name="l00983"></a>00983 <span class="keywordtype">char</span> B;
  1073. <a name="l00984"></a>00984
  1074. <a name="l00985"></a>00985 B = W[0]; W[0] = W[1]; W[1] = B;
  1075. <a name="l00986"></a>00986 }
  1076. <a name="l00987"></a>00987
  1077. <a name="l00988"></a><a class="code" href="pumax_8c.html#a532f021f00307a41076fe9bc90f4256a">00988</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a532f021f00307a41076fe9bc90f4256a">SwapIEEE32</a>(<span class="keywordtype">char</span> W[4])
  1078. <a name="l00989"></a>00989 {
  1079. <a name="l00990"></a>00990 <span class="keywordtype">char</span> B;
  1080. <a name="l00991"></a>00991
  1081. <a name="l00992"></a>00992 B = W[0]; W[0] = W[3]; W[3] = B;
  1082. <a name="l00993"></a>00993 B = W[1]; W[1] = W[2]; W[2] = B;
  1083. <a name="l00994"></a>00994 }
  1084. <a name="l00995"></a>00995
  1085. <a name="l00996"></a><a class="code" href="pumax_8c.html#a0ebbbcd7d22dfb611d01499a87802d6e">00996</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a0ebbbcd7d22dfb611d01499a87802d6e">ReadINT</a>(FILE *fpi)
  1086. <a name="l00997"></a>00997 {
  1087. <a name="l00998"></a>00998 <span class="keywordtype">int</span> k;
  1088. <a name="l00999"></a>00999 fread(&amp;k,<span class="keyword">sizeof</span>(k),1,fpi);
  1089. <a name="l01000"></a>01000 <span class="keywordflow">if</span> (BigEndian) <a class="code" href="pumax_8c.html#a532f021f00307a41076fe9bc90f4256a">SwapIEEE32</a>((<span class="keywordtype">char</span> *)&amp;k);
  1090. <a name="l01001"></a>01001 <span class="keywordflow">return</span> k;
  1091. <a name="l01002"></a>01002 }
  1092. <a name="l01003"></a>01003
  1093. <a name="l01004"></a><a class="code" href="pumax_8c.html#afffefaf1d789c0b6c1c9fd9d8251d402">01004</a> <span class="keywordtype">short</span> <a class="code" href="pumax_8c.html#afffefaf1d789c0b6c1c9fd9d8251d402">ReadSHORT</a>(FILE *fpi)
  1094. <a name="l01005"></a>01005 {
  1095. <a name="l01006"></a>01006 <span class="keywordtype">short</span> k;
  1096. <a name="l01007"></a>01007 fread(&amp;k,<span class="keyword">sizeof</span>(k),1,fpi);
  1097. <a name="l01008"></a>01008 <span class="keywordflow">if</span> (BigEndian) <a class="code" href="pumax_8c.html#ac8dc7ad258c2b3a3f4a3780db763bad7">SwapIEEE16</a>((<span class="keywordtype">char</span> *)&amp;k);
  1098. <a name="l01009"></a>01009 <span class="keywordflow">return</span> k;
  1099. <a name="l01010"></a>01010 }
  1100. <a name="l01011"></a>01011
  1101. <a name="l01012"></a><a class="code" href="pumax_8c.html#a41e1f6018aa05db3f476b89732b96923">01012</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a41e1f6018aa05db3f476b89732b96923">ReadImage</a>(<span class="keyword">struct</span> <a class="code" href="struct_map_image_struct.html">MapImageStruct</a> *ei, <span class="keywordtype">char</span> *filename)
  1102. <a name="l01013"></a>01013 {
  1103. <a name="l01014"></a>01014 <span class="keywordtype">char</span> ch;
  1104. <a name="l01015"></a>01015 <span class="keywordtype">int</span> i,n,x,y,z;
  1105. <a name="l01016"></a>01016 <span class="keywordtype">long</span> <a class="code" href="struct_map_image_struct.html#a0c135dc0852d411fd87b7ac84ba55664">r</a>,g,b;
  1106. <a name="l01017"></a>01017 <span class="keywordtype">int</span> FileSize;
  1107. <a name="l01018"></a>01018 <span class="keywordtype">int</span> Reserved;
  1108. <a name="l01019"></a>01019 <span class="keywordtype">int</span> OffBits;
  1109. <a name="l01020"></a>01020 <span class="keywordtype">int</span> PicBytes;
  1110. <a name="l01021"></a>01021 <span class="keywordtype">int</span> ImgBytes;
  1111. <a name="l01022"></a>01022 <span class="keywordtype">int</span> PadWidth;
  1112. <a name="l01023"></a>01023 <span class="keywordtype">int</span> PadBytes;
  1113. <a name="l01024"></a>01024 <span class="keywordtype">int</span> bpp;
  1114. <a name="l01025"></a>01025 <span class="keywordtype">int</span> byr;
  1115. <a name="l01026"></a>01026 FILE *fp;
  1116. <a name="l01027"></a>01027 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *BuffImageData;
  1117. <a name="l01028"></a>01028
  1118. <a name="l01029"></a>01029 <span class="keywordflow">if</span> (!(fp = fopen(filename,<span class="stringliteral">&quot;r&quot;</span>))) <span class="keywordflow">return</span>;
  1119. <a name="l01030"></a>01030 ch = fgetc(fp);
  1120. <a name="l01031"></a>01031 <span class="keywordflow">if</span> (ch != <span class="charliteral">&#39;B&#39;</span>) <span class="keywordflow">return</span>;
  1121. <a name="l01032"></a>01032 ch = fgetc(fp);
  1122. <a name="l01033"></a>01033 <span class="keywordflow">if</span> (ch != <span class="charliteral">&#39;M&#39;</span>) <span class="keywordflow">return</span>;
  1123. <a name="l01034"></a>01034 FileSize = <a class="code" href="pumax_8c.html#a0ebbbcd7d22dfb611d01499a87802d6e">ReadINT</a>(fp);
  1124. <a name="l01035"></a>01035 Reserved = <a class="code" href="pumax_8c.html#a0ebbbcd7d22dfb611d01499a87802d6e">ReadINT</a>(fp);
  1125. <a name="l01036"></a>01036 OffBits = <a class="code" href="pumax_8c.html#a0ebbbcd7d22dfb611d01499a87802d6e">ReadINT</a>(fp);
  1126. <a name="l01037"></a>01037
  1127. <a name="l01038"></a>01038 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">Debug</a>)
  1128. <a name="l01039"></a>01039 {
  1129. <a name="l01040"></a>01040 printf(<span class="stringliteral">&quot;Properties of %s:\n&quot;</span>,filename);
  1130. <a name="l01041"></a>01041 printf(<span class="stringliteral">&quot;FileSize = %d\n&quot;</span>,FileSize);
  1131. <a name="l01042"></a>01042 printf(<span class="stringliteral">&quot;FileOffset = %d\n&quot;</span>,OffBits);
  1132. <a name="l01043"></a>01043 }
  1133. <a name="l01044"></a>01044
  1134. <a name="l01045"></a>01045 <a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#acfe239d5fa92bc82701fafaf72efcacf">Size</a> = <a class="code" href="pumax_8c.html#a0ebbbcd7d22dfb611d01499a87802d6e">ReadINT</a>(fp);
  1135. <a name="l01046"></a>01046 <a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a6486fcb19864264947f29b30c5a1d6e9">Width</a> = <a class="code" href="pumax_8c.html#a0ebbbcd7d22dfb611d01499a87802d6e">ReadINT</a>(fp);
  1136. <a name="l01047"></a>01047 <a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a52746e7d2f7de61866c6a2217083d1a5">Height</a> = <a class="code" href="pumax_8c.html#a0ebbbcd7d22dfb611d01499a87802d6e">ReadINT</a>(fp);
  1137. <a name="l01048"></a>01048 <a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a29b39d5bd71bb03b8b09b0de1a4b9c8d">Planes</a> = <a class="code" href="pumax_8c.html#afffefaf1d789c0b6c1c9fd9d8251d402">ReadSHORT</a>(fp);
  1138. <a name="l01049"></a>01049 <a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a116a68a16b53430a1a9f0bdf657e53c8">Count</a> = <a class="code" href="pumax_8c.html#afffefaf1d789c0b6c1c9fd9d8251d402">ReadSHORT</a>(fp);
  1139. <a name="l01050"></a>01050 <a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a28c320842950835ff4de540ed4c4b4fd">Compression</a> = <a class="code" href="pumax_8c.html#a0ebbbcd7d22dfb611d01499a87802d6e">ReadINT</a>(fp);
  1140. <a name="l01051"></a>01051 <a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a11df57e6d765d04cd654eb68e9ed5606">SizeImage</a> = <a class="code" href="pumax_8c.html#a0ebbbcd7d22dfb611d01499a87802d6e">ReadINT</a>(fp);
  1141. <a name="l01052"></a>01052 <a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#ad14c3cac819fdb1563374c2ef4913aac">XPelsPerMeter</a> = <a class="code" href="pumax_8c.html#a0ebbbcd7d22dfb611d01499a87802d6e">ReadINT</a>(fp);
  1142. <a name="l01053"></a>01053 <a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a0eae4b963d52b8a8eb15fc6275f8b481">YPelsPerMeter</a> = <a class="code" href="pumax_8c.html#a0ebbbcd7d22dfb611d01499a87802d6e">ReadINT</a>(fp);
  1143. <a name="l01054"></a>01054 <a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a8f8f9ef7e30ba0653ba479b28676c3ce">ClrUsed</a> = <a class="code" href="pumax_8c.html#a0ebbbcd7d22dfb611d01499a87802d6e">ReadINT</a>(fp);
  1144. <a name="l01055"></a>01055 <a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a357dc62501d321ff870187909c3c4b5f">ClrImportant</a> = <a class="code" href="pumax_8c.html#a0ebbbcd7d22dfb611d01499a87802d6e">ReadINT</a>(fp);
  1145. <a name="l01056"></a>01056
  1146. <a name="l01057"></a>01057 PadWidth = (<a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a6486fcb19864264947f29b30c5a1d6e9">Width</a> + 7) &amp; 0xFFF8;
  1147. <a name="l01058"></a>01058 bpp = <a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a116a68a16b53430a1a9f0bdf657e53c8">Count</a> &gt;&gt; 3;
  1148. <a name="l01059"></a>01059 PadBytes = (4 - ((<a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a6486fcb19864264947f29b30c5a1d6e9">Width</a> * bpp) % 4)) % 4 ;
  1149. <a name="l01060"></a>01060
  1150. <a name="l01061"></a>01061 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">Debug</a>)
  1151. <a name="l01062"></a>01062 {
  1152. <a name="l01063"></a>01063 printf(<span class="stringliteral">&quot;BMI Size = %d\n&quot;</span>,<a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#acfe239d5fa92bc82701fafaf72efcacf">Size</a>);
  1153. <a name="l01064"></a>01064 printf(<span class="stringliteral">&quot;BMI Width = %d\n&quot;</span>,<a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a6486fcb19864264947f29b30c5a1d6e9">Width</a>);
  1154. <a name="l01065"></a>01065 printf(<span class="stringliteral">&quot;BMI Height = %d\n&quot;</span>,<a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a52746e7d2f7de61866c6a2217083d1a5">Height</a>);
  1155. <a name="l01066"></a>01066 printf(<span class="stringliteral">&quot;BMI Planes = %d\n&quot;</span>,<a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a29b39d5bd71bb03b8b09b0de1a4b9c8d">Planes</a>);
  1156. <a name="l01067"></a>01067 printf(<span class="stringliteral">&quot;BMI Count = %d\n&quot;</span>,<a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a116a68a16b53430a1a9f0bdf657e53c8">Count</a>);
  1157. <a name="l01068"></a>01068 printf(<span class="stringliteral">&quot;BMI ClrUsed = %d\n&quot;</span>,<a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a8f8f9ef7e30ba0653ba479b28676c3ce">ClrUsed</a>);
  1158. <a name="l01069"></a>01069 printf(<span class="stringliteral">&quot;Pad Bytes = %d\n&quot;</span>,PadBytes);
  1159. <a name="l01070"></a>01070 printf(<span class="stringliteral">&quot;ScreenD= %d\n&quot;</span>,ScreenD);
  1160. <a name="l01071"></a>01071 }
  1161. <a name="l01072"></a>01072
  1162. <a name="l01073"></a>01073 PicBytes = (bpp * <a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a6486fcb19864264947f29b30c5a1d6e9">Width</a> + PadBytes) * <a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a52746e7d2f7de61866c6a2217083d1a5">Height</a>;
  1163. <a name="l01074"></a>01074 ImgBytes = 4 * PadWidth * <a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a52746e7d2f7de61866c6a2217083d1a5">Height</a>;
  1164. <a name="l01075"></a>01075 ei-&gt;<a class="code" href="struct_map_image_struct.html#aef0d9e2ef28e765f15559ff077d9fe26">d</a> = calloc(ImgBytes,1);
  1165. <a name="l01076"></a>01076 BuffImageData = malloc(PicBytes);
  1166. <a name="l01077"></a>01077 n = fread(BuffImageData,PicBytes,1,fp);
  1167. <a name="l01078"></a>01078 fclose(fp);
  1168. <a name="l01079"></a>01079
  1169. <a name="l01080"></a>01080 ei-&gt;<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a> = XCreateImage(display,CopyFromParent,ScreenD,ZPixmap,0,
  1170. <a name="l01081"></a>01081 ei-&gt;<a class="code" href="struct_map_image_struct.html#aef0d9e2ef28e765f15559ff077d9fe26">d</a>,PadWidth,<a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a52746e7d2f7de61866c6a2217083d1a5">Height</a>,8,0);
  1171. <a name="l01082"></a>01082
  1172. <a name="l01083"></a>01083 <span class="keywordflow">for</span> (y = 0 ; y &lt; <a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a52746e7d2f7de61866c6a2217083d1a5">Height</a> ; ++y)
  1173. <a name="l01084"></a>01084 <span class="keywordflow">for</span> (x = 0 ; x &lt; <a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a6486fcb19864264947f29b30c5a1d6e9">Width</a> ; ++x)
  1174. <a name="l01085"></a>01085 {
  1175. <a name="l01086"></a>01086 i = bpp * x + (<a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a52746e7d2f7de61866c6a2217083d1a5">Height</a> - 1 - y) * (<a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a6486fcb19864264947f29b30c5a1d6e9">Width</a>*bpp+PadBytes);
  1176. <a name="l01087"></a>01087 r = BuffImageData[i ];
  1177. <a name="l01088"></a>01088 g = BuffImageData[i+1];
  1178. <a name="l01089"></a>01089 b = BuffImageData[i+2];
  1179. <a name="l01090"></a>01090 XPutPixel(ei-&gt;<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a>, x, y, <a class="code" href="pumax_8c.html#a6abc2b45ddd56d2171e775e89537fc04">create_pixel</a>(r,g,b));
  1180. <a name="l01091"></a>01091 }
  1181. <a name="l01092"></a>01092 free(BuffImageData);
  1182. <a name="l01093"></a>01093 ei-&gt;<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a> = <a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a6486fcb19864264947f29b30c5a1d6e9">Width</a>;
  1183. <a name="l01094"></a>01094 ei-&gt;<a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a> = <a class="code" href="pumax_8c.html#a6691345cd489f9044e316a74186ba47f">ImageBMI</a>.<a class="code" href="struct_b_m_istruct.html#a52746e7d2f7de61866c6a2217083d1a5">Height</a>;
  1184. <a name="l01095"></a>01095 }
  1185. <a name="l01096"></a>01096
  1186. <a name="l01097"></a>01097
  1187. <a name="l01098"></a><a class="code" href="pumax_8c.html#a9a77522ccd12c4a90555384a383b8537">01098</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a9a77522ccd12c4a90555384a383b8537">ntocdat</a>(<span class="keywordtype">void</span>)
  1188. <a name="l01099"></a>01099 {
  1189. <a name="l01100"></a>01100 <span class="keywordflow">if</span> (ndatim[1] &gt; 0)
  1190. <a name="l01101"></a>01101 {
  1191. <a name="l01102"></a>01102 <span class="keywordflow">if</span> (ndatim[5] &gt;= 0)
  1192. <a name="l01103"></a>01103 sprintf(datch,<span class="stringliteral">&quot;%s %2d-%s-%04d %2d:%02d&quot;</span>,wena[ndatim[5]],ndatim[2],mona[ndatim[1]-1],
  1193. <a name="l01104"></a>01104 ndatim[0],ndatim[3],ndatim[4]);
  1194. <a name="l01105"></a>01105 <span class="keywordflow">else</span>
  1195. <a name="l01106"></a>01106 sprintf(datch,<span class="stringliteral">&quot;%2d-%s-%04d %2d:%02d&quot;</span>,ndatim[2],mona[ndatim[1]-1],
  1196. <a name="l01107"></a>01107 ndatim[0],ndatim[3],ndatim[4]);
  1197. <a name="l01108"></a>01108 }
  1198. <a name="l01109"></a>01109 }
  1199. <a name="l01110"></a>01110
  1200. <a name="l01111"></a>01111 <span class="comment">/* ============================================== */</span>
  1201. <a name="l01112"></a>01112 <span class="comment">/* CharAlloc - Allocate space for character array */</span>
  1202. <a name="l01113"></a>01113 <span class="comment">/* ============================================== */</span>
  1203. <a name="l01114"></a>01114
  1204. <a name="l01115"></a><a class="code" href="pumax_8c.html#af4c16744d5918311b39441909c66c69c">01115</a> <span class="keywordtype">char</span> *<a class="code" href="pumax_8c.html#af4c16744d5918311b39441909c66c69c">CharAlloc</a>(<span class="keywordtype">int</span> bytes,<span class="keywordtype">char</span> *array_name)
  1205. <a name="l01116"></a>01116 {
  1206. <a name="l01117"></a>01117 <span class="keywordtype">char</span> *result = NULL;
  1207. <a name="l01118"></a>01118 <span class="keywordflow">if</span> (bytes &gt; 0)
  1208. <a name="l01119"></a>01119 {
  1209. <a name="l01120"></a>01120 result = (<span class="keywordtype">char</span> *)calloc(bytes, <span class="keyword">sizeof</span>(<span class="keywordtype">char</span>));
  1210. <a name="l01121"></a>01121 <span class="keywordflow">if</span> (!result || <a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">Debug</a>)
  1211. <a name="l01122"></a>01122 {
  1212. <a name="l01123"></a>01123 <span class="keywordflow">if</span> (!result) printf(<span class="stringliteral">&quot;*** Out of Memory *** on &quot;</span>);
  1213. <a name="l01124"></a>01124 printf(<span class="stringliteral">&quot;CharAlloc: at%10p %6d char for %-30.30s\n&quot;</span>,
  1214. <a name="l01125"></a>01125 result,bytes,array_name);
  1215. <a name="l01126"></a>01126 }
  1216. <a name="l01127"></a>01127 }
  1217. <a name="l01128"></a>01128 <span class="keywordflow">return</span>(result);
  1218. <a name="l01129"></a>01129 }
  1219. <a name="l01130"></a>01130
  1220. <a name="l01131"></a>01131 <span class="comment">/* ======================================= */</span>
  1221. <a name="l01132"></a>01132 <span class="comment">/* IntAlloc - Allocate space for int array */</span>
  1222. <a name="l01133"></a>01133 <span class="comment">/* ======================================= */</span>
  1223. <a name="l01134"></a>01134
  1224. <a name="l01135"></a><a class="code" href="pumax_8c.html#a97eea41da1321e51271d6dd6c42219cb">01135</a> <span class="keywordtype">int</span> *<a class="code" href="pumax_8c.html#a97eea41da1321e51271d6dd6c42219cb">IntAlloc</a>(<span class="keywordtype">int</span> words,<span class="keywordtype">char</span> *array_name)
  1225. <a name="l01136"></a>01136 {
  1226. <a name="l01137"></a>01137 <span class="keywordtype">int</span> *result = NULL;
  1227. <a name="l01138"></a>01138 <span class="keywordflow">if</span> (words &gt; 0)
  1228. <a name="l01139"></a>01139 {
  1229. <a name="l01140"></a>01140 result = (<span class="keywordtype">int</span> *) calloc(words, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>));
  1230. <a name="l01141"></a>01141 <span class="keywordflow">if</span> (!result || <a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">Debug</a>)
  1231. <a name="l01142"></a>01142 {
  1232. <a name="l01143"></a>01143 <span class="keywordflow">if</span> (!result) printf(<span class="stringliteral">&quot;*** Out of Memory *** on &quot;</span>);
  1233. <a name="l01144"></a>01144 printf(<span class="stringliteral">&quot;IntAlloc: at%10p %6d int for %s\n&quot;</span>,
  1234. <a name="l01145"></a>01145 result,words,array_name);
  1235. <a name="l01146"></a>01146 }
  1236. <a name="l01147"></a>01147 }
  1237. <a name="l01148"></a>01148 <span class="keywordflow">return</span>(result);
  1238. <a name="l01149"></a>01149 }
  1239. <a name="l01150"></a>01150
  1240. <a name="l01151"></a>01151 <span class="comment">/* =========================================== */</span>
  1241. <a name="l01152"></a>01152 <span class="comment">/* FloatAlloc - Allocate space for float array */</span>
  1242. <a name="l01153"></a>01153 <span class="comment">/* =========================================== */</span>
  1243. <a name="l01154"></a>01154
  1244. <a name="l01155"></a><a class="code" href="pumax_8c.html#a2ec2314ef785dc1cddc562590cd034ad">01155</a> <span class="keywordtype">float</span> *<a class="code" href="pumax_8c.html#a2ec2314ef785dc1cddc562590cd034ad">FloatAlloc</a>(<span class="keywordtype">int</span> words, <span class="keywordtype">char</span> *array_name)
  1245. <a name="l01156"></a>01156 {
  1246. <a name="l01157"></a>01157 <span class="keywordtype">float</span> *result = NULL;
  1247. <a name="l01158"></a>01158 <span class="keywordflow">if</span> (words &gt; 0)
  1248. <a name="l01159"></a>01159 {
  1249. <a name="l01160"></a>01160 result = (<span class="keywordtype">float</span> *) calloc(words, <span class="keyword">sizeof</span>(<span class="keywordtype">float</span>));
  1250. <a name="l01161"></a>01161 <span class="keywordflow">if</span> (!result || <a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">Debug</a>)
  1251. <a name="l01162"></a>01162 {
  1252. <a name="l01163"></a>01163 <span class="keywordflow">if</span> (!result) printf(<span class="stringliteral">&quot;*** Out of Memory *** on &quot;</span>);
  1253. <a name="l01164"></a>01164 printf(<span class="stringliteral">&quot;FloatAlloc: at%10p %6d float for %s\n&quot;</span>,
  1254. <a name="l01165"></a>01165 result,words,array_name);
  1255. <a name="l01166"></a>01166 }
  1256. <a name="l01167"></a>01167 }
  1257. <a name="l01168"></a>01168 <span class="keywordflow">return</span>(result);
  1258. <a name="l01169"></a>01169 }
  1259. <a name="l01170"></a>01170
  1260. <a name="l01171"></a>01171 <span class="comment">/* ========================================== */</span>
  1261. <a name="l01172"></a>01172 <span class="comment">/* SizeAlloc - Allocate space for sized array */</span>
  1262. <a name="l01173"></a>01173 <span class="comment">/* ========================================== */</span>
  1263. <a name="l01174"></a>01174
  1264. <a name="l01175"></a><a class="code" href="pumax_8c.html#aa507b1280c95bd8fb1d42c60d91e02ff">01175</a> <span class="keywordtype">void</span> *<a class="code" href="pumax_8c.html#aa507b1280c95bd8fb1d42c60d91e02ff">SizeAlloc</a>(<span class="keywordtype">int</span> words, <span class="keywordtype">int</span> Size, <span class="keywordtype">char</span> *array_name)
  1265. <a name="l01176"></a>01176 {
  1266. <a name="l01177"></a>01177 <span class="keywordtype">void</span> *result = NULL;
  1267. <a name="l01178"></a>01178 <span class="keywordflow">if</span> (words &gt; 0)
  1268. <a name="l01179"></a>01179 {
  1269. <a name="l01180"></a>01180 result = (<span class="keywordtype">void</span> *) calloc(words, Size);
  1270. <a name="l01181"></a>01181 <span class="keywordflow">if</span> (!result || <a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">Debug</a>)
  1271. <a name="l01182"></a>01182 {
  1272. <a name="l01183"></a>01183 <span class="keywordflow">if</span> (!result) printf(<span class="stringliteral">&quot;*** Out of Memory *** on &quot;</span>);
  1273. <a name="l01184"></a>01184 printf(<span class="stringliteral">&quot;SizeAlloc: at%10p %6d void for %s\n&quot;</span>,
  1274. <a name="l01185"></a>01185 result,words,array_name);
  1275. <a name="l01186"></a>01186 }
  1276. <a name="l01187"></a>01187 }
  1277. <a name="l01188"></a>01188 <span class="keywordflow">return</span>(result);
  1278. <a name="l01189"></a>01189 }
  1279. <a name="l01190"></a>01190
  1280. <a name="l01191"></a><a class="code" href="pumax_8c.html#a51c0b8738867e745ec3ebd94e879f08f">01191</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a51c0b8738867e745ec3ebd94e879f08f">LoadFonts</a>(<span class="keywordtype">void</span>)
  1281. <a name="l01192"></a>01192 {
  1282. <a name="l01193"></a>01193 <span class="keywordflow">if</span> ((FixFont = XLoadQueryFont(display,FixFontName)) == NULL)
  1283. <a name="l01194"></a>01194 {
  1284. <a name="l01195"></a>01195 printf(<span class="stringliteral">&quot;%s: Cannot open %s font\n&quot;</span>,progname,FixFontName);
  1285. <a name="l01196"></a>01196 exit(-1);
  1286. <a name="l01197"></a>01197 }
  1287. <a name="l01198"></a>01198 <span class="keywordflow">if</span> ((SubFont = XLoadQueryFont(display,SubFontName)) == NULL)
  1288. <a name="l01199"></a>01199 {
  1289. <a name="l01200"></a>01200 SubFont = <a class="code" href="pumax_8c.html#aa665023c2263df19f760e32916bc9e42">FixFont</a>;
  1290. <a name="l01201"></a>01201 }
  1291. <a name="l01202"></a>01202 <span class="keywordflow">if</span> ((BigFont = XLoadQueryFont(display,BigFontName)) == NULL)
  1292. <a name="l01203"></a>01203 {
  1293. <a name="l01204"></a>01204 <span class="keywordflow">if</span> ((BigFont = XLoadQueryFont(display,<span class="stringliteral">&quot;10x20&quot;</span>)) == NULL)
  1294. <a name="l01205"></a>01205 {
  1295. <a name="l01206"></a>01206 printf(<span class="stringliteral">&quot;%s: Cannot open %s font\n&quot;</span>,progname,BigFontName);
  1296. <a name="l01207"></a>01207 exit(-1);
  1297. <a name="l01208"></a>01208 }
  1298. <a name="l01209"></a>01209 }
  1299. <a name="l01210"></a>01210 FixFontWidth = XTextWidth(FixFont,<span class="stringliteral">&quot;X&quot;</span>,1);
  1300. <a name="l01211"></a>01211 SubFontWidth = XTextWidth(SubFont,<span class="stringliteral">&quot;X&quot;</span>,1);
  1301. <a name="l01212"></a>01212 BigFontWidth = XTextWidth(BigFont,<span class="stringliteral">&quot;X&quot;</span>,1);
  1302. <a name="l01213"></a>01213 FixFontHeight = FixFont-&gt;ascent + FixFont-&gt;descent;
  1303. <a name="l01214"></a>01214 SubFontHeight = SubFont-&gt;ascent + SubFont-&gt;descent;
  1304. <a name="l01215"></a>01215 BigFontHeight = BigFont-&gt;ascent + BigFont-&gt;descent;
  1305. <a name="l01216"></a>01216 }
  1306. <a name="l01217"></a>01217
  1307. <a name="l01218"></a><a class="code" href="pumax_8c.html#a77c9c27e1c3052a37c3cb275828ae40d">01218</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a77c9c27e1c3052a37c3cb275828ae40d">AllocateColorCells</a>(<span class="keyword">struct</span> <a class="code" href="struct_color_strip.html">ColorStrip</a> cs[])
  1308. <a name="l01219"></a>01219 {
  1309. <a name="l01220"></a>01220 <span class="keywordtype">int</span> i = 0;
  1310. <a name="l01221"></a>01221 XColor <a class="code" href="pumax_8c.html#a9977d5ab51b6b525c34f9730753798e0">xcolor1</a>,<a class="code" href="pumax_8c.html#a4cd38c53dcf67c955c7cb4e4d35c0423">xcolor2</a>;
  1311. <a name="l01222"></a>01222
  1312. <a name="l01223"></a>01223 <span class="keywordflow">while</span> (cs[i].Name)
  1313. <a name="l01224"></a>01224 {
  1314. <a name="l01225"></a>01225 XAllocNamedColor(display,colormap,cs[i].Name,&amp;xcolor1,&amp;xcolor2);
  1315. <a name="l01226"></a>01226 cs[i].<a class="code" href="struct_color_strip.html#ab1a6137a580d2a1817f4d8e127d4743c">pixel</a> = xcolor1.pixel;
  1316. <a name="l01227"></a>01227 ++i;
  1317. <a name="l01228"></a>01228 }
  1318. <a name="l01229"></a>01229 <span class="keywordflow">return</span> i;
  1319. <a name="l01230"></a>01230 }
  1320. <a name="l01231"></a>01231
  1321. <a name="l01232"></a><a class="code" href="pumax_8c.html#ade32a2443eb96bdf5e02320868703e0f">01232</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#ade32a2443eb96bdf5e02320868703e0f">CalcButtonAreas</a>(<span class="keywordtype">void</span>)
  1322. <a name="l01233"></a>01233 {
  1323. <a name="l01234"></a>01234 <span class="keywordtype">int</span> of,ds,bh,fh,fw,j;
  1324. <a name="l01235"></a>01235
  1325. <a name="l01236"></a>01236 of = <a class="code" href="pumax_8c.html#af92a559968f024eaf3b09e93db8c4ac3">OffsetY</a>;
  1326. <a name="l01237"></a>01237 ds = 10;
  1327. <a name="l01238"></a>01238 bh = 30;
  1328. <a name="l01239"></a>01239 fh = <a class="code" href="pumax_8c.html#a1d2254b4c4eccb72efc38d231910fe68">BigFontHeight</a>;
  1329. <a name="l01240"></a>01240 fw = <a class="code" href="pumax_8c.html#aefafab89c009b3e4258f1216ae91e76c">BigFontWidth</a>;
  1330. <a name="l01241"></a>01241
  1331. <a name="l01242"></a>01242 <span class="comment">/* 1. Stop Button */</span>
  1332. <a name="l01243"></a>01243
  1333. <a name="l01244"></a>01244 StopButton[0].y += <a class="code" href="pumax_8c.html#af92a559968f024eaf3b09e93db8c4ac3">OffsetY</a>;
  1334. <a name="l01245"></a>01245 StopButton[1].y += <a class="code" href="pumax_8c.html#af92a559968f024eaf3b09e93db8c4ac3">OffsetY</a>;
  1335. <a name="l01246"></a>01246 StopButton[2].y += <a class="code" href="pumax_8c.html#af92a559968f024eaf3b09e93db8c4ac3">OffsetY</a>;
  1336. <a name="l01247"></a>01247 StopButton[3].y += <a class="code" href="pumax_8c.html#af92a559968f024eaf3b09e93db8c4ac3">OffsetY</a>;
  1337. <a name="l01248"></a>01248
  1338. <a name="l01249"></a>01249 Stop_XL = ds;
  1339. <a name="l01250"></a>01250 Stop_XH = Stop_XL + bh;
  1340. <a name="l01251"></a>01251 Stop_YL = of + ds;
  1341. <a name="l01252"></a>01252 Stop_YH = Stop_YL + bh;
  1342. <a name="l01253"></a>01253
  1343. <a name="l01254"></a>01254 <span class="comment">/* 2. Start Button */</span>
  1344. <a name="l01255"></a>01255
  1345. <a name="l01256"></a>01256 Start_XL = Stop_XH + ds;
  1346. <a name="l01257"></a>01257 Start_XH = Start_XL + bh;
  1347. <a name="l01258"></a>01258 Start_YL = <a class="code" href="pumax_8c.html#a91b3c0f8c4770ad36e64106a0aebc691">Stop_YL</a>;
  1348. <a name="l01259"></a>01259 Start_YH = <a class="code" href="pumax_8c.html#a8e6314067e8a239ee1389b87e06d60d6">Stop_YH</a>;
  1349. <a name="l01260"></a>01260
  1350. <a name="l01261"></a>01261 StartButton[0].y += <a class="code" href="pumax_8c.html#af92a559968f024eaf3b09e93db8c4ac3">OffsetY</a>;
  1351. <a name="l01262"></a>01262 StartButton[1].y += <a class="code" href="pumax_8c.html#af92a559968f024eaf3b09e93db8c4ac3">OffsetY</a>;
  1352. <a name="l01263"></a>01263 StartButton[2].y += <a class="code" href="pumax_8c.html#af92a559968f024eaf3b09e93db8c4ac3">OffsetY</a>;
  1353. <a name="l01264"></a>01264
  1354. <a name="l01265"></a>01265 <span class="comment">/* 3. Pause Button */</span>
  1355. <a name="l01266"></a>01266
  1356. <a name="l01267"></a>01267 Pause_XL = Start_XH + 15;
  1357. <a name="l01268"></a>01268 Pause_XH = Start_XH + 35;
  1358. <a name="l01269"></a>01269 Pause_YL = <a class="code" href="pumax_8c.html#aa6b7da43e548f98c9c0a1aa042955e53">Start_YL</a>;
  1359. <a name="l01270"></a>01270 Pause_YH = <a class="code" href="pumax_8c.html#ad7f26c40f9aa636fc053415fa4a49649">Start_YH</a>;
  1360. <a name="l01271"></a>01271
  1361. <a name="l01272"></a>01272 PauseButton1[0].y += <a class="code" href="pumax_8c.html#af92a559968f024eaf3b09e93db8c4ac3">OffsetY</a>;
  1362. <a name="l01273"></a>01273 PauseButton1[1].y += <a class="code" href="pumax_8c.html#af92a559968f024eaf3b09e93db8c4ac3">OffsetY</a>;
  1363. <a name="l01274"></a>01274 PauseButton1[2].y += <a class="code" href="pumax_8c.html#af92a559968f024eaf3b09e93db8c4ac3">OffsetY</a>;
  1364. <a name="l01275"></a>01275 PauseButton1[3].y += <a class="code" href="pumax_8c.html#af92a559968f024eaf3b09e93db8c4ac3">OffsetY</a>;
  1365. <a name="l01276"></a>01276
  1366. <a name="l01277"></a>01277 PauseButton2[0].y += <a class="code" href="pumax_8c.html#af92a559968f024eaf3b09e93db8c4ac3">OffsetY</a>;
  1367. <a name="l01278"></a>01278 PauseButton2[1].y += <a class="code" href="pumax_8c.html#af92a559968f024eaf3b09e93db8c4ac3">OffsetY</a>;
  1368. <a name="l01279"></a>01279 PauseButton2[2].y += <a class="code" href="pumax_8c.html#af92a559968f024eaf3b09e93db8c4ac3">OffsetY</a>;
  1369. <a name="l01280"></a>01280 PauseButton2[3].y += <a class="code" href="pumax_8c.html#af92a559968f024eaf3b09e93db8c4ac3">OffsetY</a>;
  1370. <a name="l01281"></a>01281
  1371. <a name="l01282"></a>01282 <span class="comment">/* 4. Help Button */</span>
  1372. <a name="l01283"></a>01283
  1373. <a name="l01284"></a>01284 Help_XL = 200;
  1374. <a name="l01285"></a>01285 Help_XH = Help_XL + 5 * fw;
  1375. <a name="l01286"></a>01286 Help_YL = <a class="code" href="pumax_8c.html#a62f16cafe798c067ab8a6effb26b21c2">Pause_YL</a>;
  1376. <a name="l01287"></a>01287 Help_YH = <a class="code" href="pumax_8c.html#a335dc1da623733cdc46be9818f7faeb5">Pause_YH</a>;
  1377. <a name="l01288"></a>01288
  1378. <a name="l01289"></a>01289 <span class="comment">/* 5. Minus &amp; FBWD Button */</span>
  1379. <a name="l01290"></a>01290
  1380. <a name="l01291"></a>01291 Minus_XL = 300;
  1381. <a name="l01292"></a>01292 Minus_XH = Minus_XL + fh;
  1382. <a name="l01293"></a>01293 Minus_YL = Pause_YL + (bh - fh) / 2;
  1383. <a name="l01294"></a>01294 Minus_YH = Minus_YL + fh;
  1384. <a name="l01295"></a>01295
  1385. <a name="l01296"></a>01296 FBWD_XH = Minus_XL - ds/2;
  1386. <a name="l01297"></a>01297 FBWD_XL = FBWD_XH - fh;
  1387. <a name="l01298"></a>01298 FBWD_YL = <a class="code" href="pumax_8c.html#a8eed85ad2425df37d1a278571e0e2268">Minus_YL</a>;
  1388. <a name="l01299"></a>01299 FBWD_YH = <a class="code" href="pumax_8c.html#a9f064372aac5b9c6646ae41c1366dd67">Minus_YH</a>;
  1389. <a name="l01300"></a>01300
  1390. <a name="l01301"></a>01301 <span class="comment">/* 6. Parameter Change Area */</span>
  1391. <a name="l01302"></a>01302
  1392. <a name="l01303"></a>01303 Parc_XL = Minus_XH + ds;
  1393. <a name="l01304"></a>01304 Parc_XH = Parc_XL + fw * 14;
  1394. <a name="l01305"></a>01305 Parc_YL = <a class="code" href="pumax_8c.html#a8eed85ad2425df37d1a278571e0e2268">Minus_YL</a>;
  1395. <a name="l01306"></a>01306 Parc_YH = <a class="code" href="pumax_8c.html#a9f064372aac5b9c6646ae41c1366dd67">Minus_YH</a>;
  1396. <a name="l01307"></a>01307 Parc_XD = Parc_XH - <a class="code" href="pumax_8c.html#ae373f8d537ec4fe119fa2f056a1026b6">Parc_XL</a>;
  1397. <a name="l01308"></a>01308 Parc_YD = Parc_YH - <a class="code" href="pumax_8c.html#ae13ffbf97704d055020c491c4e74ff0f">Parc_YL</a>;
  1398. <a name="l01309"></a>01309
  1399. <a name="l01310"></a>01310 <span class="comment">/* 7. Plus &amp; FFWD Button */</span>
  1400. <a name="l01311"></a>01311
  1401. <a name="l01312"></a>01312 Plus_XL = Parc_XH + ds;
  1402. <a name="l01313"></a>01313 Plus_XH = Plus_XL + fh;
  1403. <a name="l01314"></a>01314 Plus_YL = <a class="code" href="pumax_8c.html#a8eed85ad2425df37d1a278571e0e2268">Minus_YL</a>;
  1404. <a name="l01315"></a>01315 Plus_YH = <a class="code" href="pumax_8c.html#a9f064372aac5b9c6646ae41c1366dd67">Minus_YH</a>;
  1405. <a name="l01316"></a>01316
  1406. <a name="l01317"></a>01317 FFWD_XL = Plus_XH + ds/2;
  1407. <a name="l01318"></a>01318 FFWD_XH = FFWD_XL + fh;
  1408. <a name="l01319"></a>01319 FFWD_YL = <a class="code" href="pumax_8c.html#ad45d3847d400c8c39d830bd219eee39f">Plus_YL</a>;
  1409. <a name="l01320"></a>01320 FFWD_YH = <a class="code" href="pumax_8c.html#a6a42672cdcc2c6cca8c6d3670fecd7c3">Plus_YH</a>;
  1410. <a name="l01321"></a>01321
  1411. <a name="l01322"></a>01322 <span class="comment">/* 8. Grid on/off box */</span>
  1412. <a name="l01323"></a>01323
  1413. <a name="l01324"></a>01324 Grid_XL = <a class="code" href="pumax_8c.html#ad24990368c579bb1864cbc8c3ce3e721">Stop_XL</a>;
  1414. <a name="l01325"></a>01325 Grid_XH = Grid_XL + <a class="code" href="pumax_8c.html#add5a8c33565a2bbcf55996cccc7a434b">FixFontHeight</a>;
  1415. <a name="l01326"></a>01326 Grid_YL = Stop_YH + 3 * BigFontHeight / 2;
  1416. <a name="l01327"></a>01327 Grid_YH = Grid_YL + <a class="code" href="pumax_8c.html#add5a8c33565a2bbcf55996cccc7a434b">FixFontHeight</a>;
  1417. <a name="l01328"></a>01328
  1418. <a name="l01329"></a>01329 <span class="comment">/* Window status and select boxes */</span>
  1419. <a name="l01330"></a>01330
  1420. <a name="l01331"></a>01331 Wbox_XL = 580;
  1421. <a name="l01332"></a>01332 Wbox_XH = Wbox_XL + <a class="code" href="pumax_8c.html#add5a8c33565a2bbcf55996cccc7a434b">FixFontHeight</a>;
  1422. <a name="l01333"></a>01333 Wbox_YL = 0;
  1423. <a name="l01334"></a>01334 Wbox_YH = NumWin * <a class="code" href="pumax_8c.html#add5a8c33565a2bbcf55996cccc7a434b">FixFontHeight</a>;
  1424. <a name="l01335"></a>01335 }
  1425. <a name="l01336"></a>01336
  1426. <a name="l01337"></a>01337
  1427. <a name="l01338"></a>01338 <span class="comment">/* Hack for getting information of window decoration */</span>
  1428. <a name="l01339"></a>01339 <span class="comment">/* especially borderwidth and titleheight */</span>
  1429. <a name="l01340"></a>01340 <span class="comment">/* These are properties of the window manager and are */</span>
  1430. <a name="l01341"></a>01341 <span class="comment">/* usually adjustable by the user */</span>
  1431. <a name="l01342"></a>01342
  1432. <a name="l01343"></a><a class="code" href="pumax_8c.html#abdb502e8465c0ed1996a3a53e2919a22">01343</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#abdb502e8465c0ed1996a3a53e2919a22">TestWindow</a>(<span class="keywordtype">int</span> xx, <span class="keywordtype">int</span> yy, <span class="keywordtype">int</span> wi, <span class="keywordtype">int</span> he, <span class="keywordtype">int</span> *x, <span class="keywordtype">int</span> *y,
  1433. <a name="l01344"></a>01344 <span class="keywordtype">int</span> *<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a>, <span class="keywordtype">int</span> *Y, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *W, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *H)
  1434. <a name="l01345"></a>01345 {
  1435. <a name="l01346"></a>01346 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> DepthReturn = 0;
  1436. <a name="l01347"></a>01347 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> BorderReturn = 0;
  1437. <a name="l01348"></a>01348 Window TW,Parent,Child;
  1438. <a name="l01349"></a>01349
  1439. <a name="l01350"></a>01350 TW = XCreateWindow(display,RootWindow(display,screen_num),
  1440. <a name="l01351"></a>01351 xx,yy,wi,he, <span class="comment">// x,y,w,h</span>
  1441. <a name="l01352"></a>01352 0,CopyFromParent,InputOutput, <span class="comment">// border, depth, class</span>
  1442. <a name="l01353"></a>01353 CopyFromParent,0,NULL); <span class="comment">// visual, valuemask, attributes</span>
  1443. <a name="l01354"></a>01354 XSelectInput(display,TW,ExposureMask);
  1444. <a name="l01355"></a>01355 XMapWindow(display,TW);
  1445. <a name="l01356"></a>01356 XMoveWindow(display,TW,xx,yy);
  1446. <a name="l01357"></a>01357 XNextEvent(display,&amp;CowEvent); <span class="comment">// Wait until WM mapped it</span>
  1447. <a name="l01358"></a>01358 XGetGeometry(display,TW,&amp;Parent,x,y,W,H,&amp;BorderReturn,&amp;DepthReturn);
  1448. <a name="l01359"></a>01359 XTranslateCoordinates(display,TW,Parent,0,0,X,Y,&amp;Child);
  1449. <a name="l01360"></a>01360 XDestroyWindow(display,TW);
  1450. <a name="l01361"></a>01361
  1451. <a name="l01362"></a>01362 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">Debug</a>)
  1452. <a name="l01363"></a>01363 {
  1453. <a name="l01364"></a>01364 printf(<span class="stringliteral">&quot;TW[%x][%x]: %4d / %4d %4d x %4d x %2d [%2d:%2d]\n&quot;</span>,
  1454. <a name="l01365"></a>01365 (<span class="keywordtype">int</span>)TW,(<span class="keywordtype">int</span>)Parent,*x,*y,*W,*H,DepthReturn,*X,*Y);
  1455. <a name="l01366"></a>01366 }
  1456. <a name="l01367"></a>01367 }
  1457. <a name="l01368"></a>01368
  1458. <a name="l01369"></a>01369
  1459. <a name="l01370"></a><a class="code" href="pumax_8c.html#a12ad38f5f4aa5d1e7bce98e305662e3b">01370</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a12ad38f5f4aa5d1e7bce98e305662e3b">CreateTestWindow</a>(<span class="keywordtype">void</span>)
  1460. <a name="l01371"></a>01371 {
  1461. <a name="l01372"></a>01372 <span class="keywordtype">int</span> <a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a>,Y,xp,yp;
  1462. <a name="l01373"></a>01373 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> W,H;
  1463. <a name="l01374"></a>01374
  1464. <a name="l01375"></a>01375 <span class="comment">// Open a test window with displacement x = 100 and y = 100</span>
  1465. <a name="l01376"></a>01376 <span class="comment">// Test the returned coordinates for upper left corner</span>
  1466. <a name="l01377"></a>01377 <span class="comment">// and compute left margin (border) and top margin (title bar)</span>
  1467. <a name="l01378"></a>01378
  1468. <a name="l01379"></a>01379 <a class="code" href="pumax_8c.html#abdb502e8465c0ed1996a3a53e2919a22">TestWindow</a>(100,100,100,100,&amp;xp,&amp;yp,&amp;X,&amp;Y,&amp;W,&amp;H);
  1469. <a name="l01380"></a>01380
  1470. <a name="l01381"></a>01381 <span class="comment">// Left margin</span>
  1471. <a name="l01382"></a>01382
  1472. <a name="l01383"></a>01383 <span class="keywordflow">if</span> (X &gt;= 100 &amp;&amp; X &lt; 110) WinLM = X - 100;
  1473. <a name="l01384"></a>01384
  1474. <a name="l01385"></a>01385 <span class="comment">// Right margin</span>
  1475. <a name="l01386"></a>01386
  1476. <a name="l01387"></a>01387 WinRM = <a class="code" href="pumax_8c.html#a0a8a8622ae71c04112e4e0d9ccda7817">WinLM</a>;
  1477. <a name="l01388"></a>01388
  1478. <a name="l01389"></a>01389 <span class="comment">// Top margin</span>
  1479. <a name="l01390"></a>01390
  1480. <a name="l01391"></a>01391 <span class="keywordflow">if</span> (Y &gt;= 100 &amp;&amp; Y &lt; 150) WinTM = Y - 100;
  1481. <a name="l01392"></a>01392 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (Y &gt; 0 &amp;&amp; Y &lt; 50) WinTM = Y;
  1482. <a name="l01393"></a>01393
  1483. <a name="l01394"></a>01394 <span class="comment">// Bottom margin</span>
  1484. <a name="l01395"></a>01395
  1485. <a name="l01396"></a>01396 WinBM = <a class="code" href="pumax_8c.html#a0a8a8622ae71c04112e4e0d9ccda7817">WinLM</a>;
  1486. <a name="l01397"></a>01397
  1487. <a name="l01398"></a>01398 <span class="comment">// Open a full screen test window</span>
  1488. <a name="l01399"></a>01399 <span class="comment">// Test the returned coordinates for upper left corner</span>
  1489. <a name="l01400"></a>01400 <span class="comment">// the y displacement should be WinTM plus Windowmanager menu bar</span>
  1490. <a name="l01401"></a>01401
  1491. <a name="l01402"></a>01402 <a class="code" href="pumax_8c.html#abdb502e8465c0ed1996a3a53e2919a22">TestWindow</a>(0,0,ScreenW,ScreenH,&amp;xp,&amp;yp,&amp;X,&amp;Y,&amp;W,&amp;H);
  1492. <a name="l01403"></a>01403
  1493. <a name="l01404"></a>01404 <span class="comment">// Window manager menu bar on top</span>
  1494. <a name="l01405"></a>01405
  1495. <a name="l01406"></a>01406 <span class="keywordflow">if</span> (yp &gt; WinTM) WM_top_area = yp - <a class="code" href="pumax_8c.html#a6529bd28fe04607bb7d71ff00a101e52">WinTM</a>;
  1496. <a name="l01407"></a>01407
  1497. <a name="l01408"></a>01408
  1498. <a name="l01409"></a>01409 <span class="comment">// Last usable scan line</span>
  1499. <a name="l01410"></a>01410
  1500. <a name="l01411"></a>01411 ScreenBot = WM_top_area + WinTM + H;
  1501. <a name="l01412"></a>01412 <span class="keywordflow">if</span> (ScreenBot &gt; ScreenH) ScreenBot = <a class="code" href="pumax_8c.html#a8b8a3a3a0640d58f940680ffabe74433">ScreenH</a>;
  1502. <a name="l01413"></a>01413
  1503. <a name="l01414"></a>01414 <span class="comment">// Are we running on a 27&quot; iMac :-)</span>
  1504. <a name="l01415"></a>01415
  1505. <a name="l01416"></a>01416 <span class="keywordflow">if</span> (ScreenW == 2560 &amp;&amp; ScreenH &gt; 1400) ScreenBot -= 100;
  1506. <a name="l01417"></a>01417
  1507. <a name="l01418"></a>01418 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">Debug</a>)
  1508. <a name="l01419"></a>01419 {
  1509. <a name="l01420"></a>01420 printf(<span class="stringliteral">&quot;Screen = %4d x %4d x %2d\n&quot;</span>,ScreenW,ScreenH,ScreenD);
  1510. <a name="l01421"></a>01421 printf(<span class="stringliteral">&quot;ScreenBot = %4d\n&quot;</span>,ScreenBot);
  1511. <a name="l01422"></a>01422 printf(<span class="stringliteral">&quot;Top reserved = %4d\n&quot;</span>,WM_top_area);
  1512. <a name="l01423"></a>01423 printf(<span class="stringliteral">&quot;Bot reserved = %4d\n&quot;</span>,ScreenH-ScreenBot);
  1513. <a name="l01424"></a>01424 printf(<span class="stringliteral">&quot;Left margin = %4d\n&quot;</span>,WinLM);
  1514. <a name="l01425"></a>01425 printf(<span class="stringliteral">&quot;Right margin = %4d\n&quot;</span>,WinRM);
  1515. <a name="l01426"></a>01426 printf(<span class="stringliteral">&quot;Top margin = %4d\n&quot;</span>,WinTM);
  1516. <a name="l01427"></a>01427 printf(<span class="stringliteral">&quot;Bot margin = %4d\n&quot;</span>,WinBM);
  1517. <a name="l01428"></a>01428 }
  1518. <a name="l01429"></a>01429 }
  1519. <a name="l01430"></a>01430
  1520. <a name="l01431"></a>01431
  1521. <a name="l01432"></a><a class="code" href="pumax_8c.html#a328ad11792a3513df3f63cf39edd9e92">01432</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a328ad11792a3513df3f63cf39edd9e92">TrimCopy</a>(<span class="keywordtype">char</span> *Trim, <span class="keywordtype">char</span> *Line, <span class="keywordtype">int</span> n)
  1522. <a name="l01433"></a>01433 {
  1523. <a name="l01434"></a>01434 <span class="keywordtype">int</span> <a class="code" href="struct_map_image_struct.html#a46fe3297a24177fa1aef6e5cf19a4b4b">l</a>;
  1524. <a name="l01435"></a>01435 <span class="keywordtype">char</span> *s;
  1525. <a name="l01436"></a>01436
  1526. <a name="l01437"></a>01437 l = strlen(Line);
  1527. <a name="l01438"></a>01438 Line[--<a class="code" href="struct_map_image_struct.html#a46fe3297a24177fa1aef6e5cf19a4b4b">l</a>] = 0; <span class="comment">// Remove linefeed</span>
  1528. <a name="l01439"></a>01439 <span class="keywordflow">while</span> (Line[l-1] == <span class="charliteral">&#39; &#39;</span>) Line[--<a class="code" href="struct_map_image_struct.html#a46fe3297a24177fa1aef6e5cf19a4b4b">l</a>] = 0; <span class="comment">// Remove trailing blanks</span>
  1529. <a name="l01440"></a>01440 s = Line;
  1530. <a name="l01441"></a>01441 <span class="keywordflow">while</span> (*s == <span class="charliteral">&#39; &#39;</span>) ++s; <span class="comment">// Remove leading blanks</span>
  1531. <a name="l01442"></a>01442 strncpy(Trim,s,n);
  1532. <a name="l01443"></a>01443 }
  1533. <a name="l01444"></a>01444
  1534. <a name="l01445"></a>01445
  1535. <a name="l01446"></a><a class="code" href="pumax_8c.html#ad40ddde2f8d2265ae3fd119645f85603">01446</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ad40ddde2f8d2265ae3fd119645f85603">ReadConfig</a>(<span class="keywordtype">char</span> *filename)
  1536. <a name="l01447"></a>01447 {
  1537. <a name="l01448"></a>01448 FILE *fp;
  1538. <a name="l01449"></a>01449 <span class="keywordtype">int</span> i,<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>,<a class="code" href="struct_map_image_struct.html#a46fe3297a24177fa1aef6e5cf19a4b4b">l</a>,s,p;
  1539. <a name="l01450"></a>01450 <span class="keywordtype">char</span> Line[256];
  1540. <a name="l01451"></a>01451 <span class="keywordtype">char</span> Plot[80];
  1541. <a name="l01452"></a>01452 <span class="keywordtype">char</span> Palette[80];
  1542. <a name="l01453"></a>01453 <span class="keywordtype">char</span> Projection[80];
  1543. <a name="l01454"></a>01454 <span class="keywordtype">char</span> Rotation[80];
  1544. <a name="l01455"></a>01455 <span class="keywordtype">char</span> *t;
  1545. <a name="l01456"></a>01456
  1546. <a name="l01457"></a>01457 fp = fopen(filename,<span class="stringliteral">&quot;r&quot;</span>);
  1547. <a name="l01458"></a>01458 <span class="keywordflow">if</span> (!fp) <span class="keywordflow">return</span> 1;
  1548. <a name="l01459"></a>01459
  1549. <a name="l01460"></a>01460 w = -2;
  1550. <a name="l01461"></a>01461 s = -1;
  1551. <a name="l01462"></a>01462 p = -1;
  1552. <a name="l01463"></a>01463 <span class="keywordflow">while</span> (!feof(fp))
  1553. <a name="l01464"></a>01464 {
  1554. <a name="l01465"></a>01465 t = fgets(Line,256,fp);
  1555. <a name="l01466"></a>01466 <span class="keywordflow">if</span> (Line[0] == <span class="charliteral">&#39;#&#39;</span>) <span class="keywordflow">continue</span>;
  1556. <a name="l01467"></a>01467 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;[Window &quot;</span> , 8) == 0) w = atoi(Line+8);
  1557. <a name="l01468"></a>01468 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;[Control&quot;</span> , 8) == 0) w = -1;
  1558. <a name="l01469"></a>01469 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;[Scalar &quot;</span> , 8) == 0) s = atoi(Line+8);
  1559. <a name="l01470"></a>01470 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;WinRows =&quot;</span> , 9) == 0)
  1560. <a name="l01471"></a>01471 {
  1561. <a name="l01472"></a>01472 WinRows = atoi(Line+9);
  1562. <a name="l01473"></a>01473 <span class="keywordflow">if</span> (WinRows &lt; 1) WinRows = 1;
  1563. <a name="l01474"></a>01474 <span class="keywordflow">if</span> (WinRows &gt; 3) WinRows = 3;
  1564. <a name="l01475"></a>01475 NumWin = WinCols * <a class="code" href="pumax_8c.html#ab109c22b7def164d1136cb9ceb9f6819">WinRows</a>;
  1565. <a name="l01476"></a>01476 }
  1566. <a name="l01477"></a>01477 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;WinCols =&quot;</span> , 9) == 0)
  1567. <a name="l01478"></a>01478 {
  1568. <a name="l01479"></a>01479 WinCols = atoi(Line+9);
  1569. <a name="l01480"></a>01480 <span class="keywordflow">if</span> (WinCols &lt; 1) WinCols = 1;
  1570. <a name="l01481"></a>01481 <span class="keywordflow">if</span> (WinCols &gt; 3) WinCols = 3;
  1571. <a name="l01482"></a>01482 NumWin = WinCols * <a class="code" href="pumax_8c.html#ab109c22b7def164d1136cb9ceb9f6819">WinRows</a>;
  1572. <a name="l01483"></a>01483 }
  1573. <a name="l01484"></a>01484 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;[Parameter &quot;</span> ,11) == 0)
  1574. <a name="l01485"></a>01485 {
  1575. <a name="l01486"></a>01486 p = atoi(Line+11);
  1576. <a name="l01487"></a>01487 <span class="keywordflow">if</span> (p &gt;= Parcs) Parcs = p+1;
  1577. <a name="l01488"></a>01488 }
  1578. <a name="l01489"></a>01489 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;Geometry:&quot;</span>,9) == 0 &amp;&amp; w &gt;= 0 &amp;&amp; w &lt; <a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>)
  1579. <a name="l01490"></a>01490 {
  1580. <a name="l01491"></a>01491 sscanf(Line+9,<span class="stringliteral">&quot;%d %d %d %d&quot;</span>,&amp;<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].w,&amp;<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].<a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a>,
  1581. <a name="l01492"></a>01492 &amp;<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].x,&amp;<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].y);
  1582. <a name="l01493"></a>01493 <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>].<a class="code" href="struct_win_att_struct.html#abd4485f9d84ad074c80fc4127922cb19">active</a> = 1;
  1583. <a name="l01494"></a>01494 }
  1584. <a name="l01495"></a>01495 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;Inactive:&quot;</span>,9) == 0 &amp;&amp; w &gt;= 0 &amp;&amp; w &lt; <a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>)
  1585. <a name="l01496"></a>01496 {
  1586. <a name="l01497"></a>01497 sscanf(Line+9,<span class="stringliteral">&quot;%d %d %d %d&quot;</span>,&amp;<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].w,&amp;<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].<a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a>,
  1587. <a name="l01498"></a>01498 &amp;<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].x,&amp;<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].y);
  1588. <a name="l01499"></a>01499 <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>].<a class="code" href="struct_win_att_struct.html#abd4485f9d84ad074c80fc4127922cb19">active</a> = 0;
  1589. <a name="l01500"></a>01500 }
  1590. <a name="l01501"></a>01501 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;Geometry:&quot;</span>,9) == 0 &amp;&amp; w == -1)
  1591. <a name="l01502"></a>01502 {
  1592. <a name="l01503"></a>01503 sscanf(Line+9,<span class="stringliteral">&quot;%d %d %d %d&quot;</span>,&amp;CowW,&amp;CowH,&amp;CowX,&amp;CowY);
  1593. <a name="l01504"></a>01504 }
  1594. <a name="l01505"></a>01505 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;Title:&quot;</span>,6) == 0 &amp;&amp; w &gt;= -1 &amp;&amp; w &lt; <a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>)
  1595. <a name="l01506"></a>01506 {
  1596. <a name="l01507"></a>01507 <span class="keywordflow">if</span> (w == -1) <a class="code" href="pumax_8c.html#a328ad11792a3513df3f63cf39edd9e92">TrimCopy</a>(PlanetName,Line+6,<span class="keyword">sizeof</span>(PlanetName)-1);
  1597. <a name="l01508"></a>01508 <span class="keywordflow">else</span> <a class="code" href="pumax_8c.html#a328ad11792a3513df3f63cf39edd9e92">TrimCopy</a>(WindowTitle[w]+wto,Line+6,79-wto);
  1598. <a name="l01509"></a>01509 }
  1599. <a name="l01510"></a>01510 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;Array:&quot;</span>,6) == 0 &amp;&amp; w &gt;= 0 &amp;&amp; w &lt; <a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>)
  1600. <a name="l01511"></a>01511 <a class="code" href="pumax_8c.html#a328ad11792a3513df3f63cf39edd9e92">TrimCopy</a>(<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].array_name,Line+6,79);
  1601. <a name="l01512"></a>01512 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;Plot:&quot;</span>,5) == 0 &amp;&amp; w &gt;= 0 &amp;&amp; w &lt; <a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>)
  1602. <a name="l01513"></a>01513 {
  1603. <a name="l01514"></a>01514 <a class="code" href="pumax_8c.html#a328ad11792a3513df3f63cf39edd9e92">TrimCopy</a>(Plot,Line+5,79);
  1604. <a name="l01515"></a>01515 <span class="keywordflow">for</span> (i=0 ; i &lt; <a class="code" href="pumax_8c.html#a834a993015b3b6e5f609501c9ada9ce7">IsoTypes</a> ; ++i)
  1605. <a name="l01516"></a>01516 <span class="keywordflow">if</span> (!strcmp(Plot,<a class="code" href="pumax_8c.html#a521281f5e10ed8f5e4cdb50ead3b2612">IsoNames</a>[i])) <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>].<a class="code" href="struct_win_att_struct.html#ac172f6d90a125507144c20f703b4a0d4">Plot</a> = i;
  1606. <a name="l01517"></a>01517 }
  1607. <a name="l01518"></a>01518 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;Projection:&quot;</span>,11) == 0 &amp;&amp; w &gt;= 0 &amp;&amp; w &lt; <a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>)
  1608. <a name="l01519"></a>01519 {
  1609. <a name="l01520"></a>01520 <a class="code" href="pumax_8c.html#a328ad11792a3513df3f63cf39edd9e92">TrimCopy</a>(Projection,Line+11,79);
  1610. <a name="l01521"></a>01521 <span class="keywordflow">for</span> (i=0 ; i &lt; <a class="code" href="pumax_8c.html#a3b66883efb152a59e42802d74245ae5a">MAXMAPS</a> ; ++i)
  1611. <a name="l01522"></a>01522 <span class="keywordflow">if</span> (!strcmp(Projection,ProNames[i])) MapPro[<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>] = i;
  1612. <a name="l01523"></a>01523 }
  1613. <a name="l01524"></a>01524 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;Rotation factor:&quot;</span>,15) == 0 &amp;&amp; w &gt;= 0 &amp;&amp; w &lt; <a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>)
  1614. <a name="l01525"></a>01525 {
  1615. <a name="l01526"></a>01526 <a class="code" href="pumax_8c.html#a328ad11792a3513df3f63cf39edd9e92">TrimCopy</a>(Rotation,Line+15,79);
  1616. <a name="l01527"></a>01527 <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>].<a class="code" href="struct_map_image_struct.html#a7c3018a3883c438e08c5632a49e39c66">f</a> = atoi(Rotation);
  1617. <a name="l01528"></a>01528 }
  1618. <a name="l01529"></a>01529 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;Palette:&quot;</span>,8) == 0 &amp;&amp; w &gt;= 0 &amp;&amp; w &lt; <a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a>)
  1619. <a name="l01530"></a>01530 {
  1620. <a name="l01531"></a>01531 <a class="code" href="pumax_8c.html#a328ad11792a3513df3f63cf39edd9e92">TrimCopy</a>(Palette,Line+8,79);
  1621. <a name="l01532"></a>01532 <span class="keywordflow">for</span> (i=0 ; i &lt; <a class="code" href="pumax_8c.html#a51158475dcc6ea9c026070a471573cf9">PalTypes</a> ; ++i)
  1622. <a name="l01533"></a>01533 <span class="keywordflow">if</span> (!strcmp(Palette,PalNames[i])) <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>].<a class="code" href="struct_win_att_struct.html#a75ef0752e759450856fd5967bdb36587">Palette</a> = i;
  1623. <a name="l01534"></a>01534 }
  1624. <a name="l01535"></a>01535
  1625. <a name="l01536"></a>01536 <span class="comment">// Dimension for time axis</span>
  1626. <a name="l01537"></a>01537
  1627. <a name="l01538"></a>01538 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;DimT:&quot;</span> ,5) == 0) DimT = atoi(Line+5);
  1628. <a name="l01539"></a>01539
  1629. <a name="l01540"></a>01540 <span class="comment">// Attributes of scalars for timeseries windows</span>
  1630. <a name="l01541"></a>01541
  1631. <a name="l01542"></a>01542 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;Name:&quot;</span> ,5) == 0 &amp;&amp; s &gt;= 0 &amp;&amp; s &lt; <a class="code" href="pumax_8c.html#a82714a35091aa707ef0bc4c0ad18d7b2">NUMSCALARS</a>)
  1632. <a name="l01543"></a>01543 <a class="code" href="pumax_8c.html#a328ad11792a3513df3f63cf39edd9e92">TrimCopy</a>(TSName[s],Line+5,79);
  1633. <a name="l01544"></a>01544 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;Sub:&quot;</span> ,4) == 0 &amp;&amp; s &gt;= 0 &amp;&amp; s &lt; <a class="code" href="pumax_8c.html#a82714a35091aa707ef0bc4c0ad18d7b2">NUMSCALARS</a>)
  1634. <a name="l01545"></a>01545 <a class="code" href="pumax_8c.html#a328ad11792a3513df3f63cf39edd9e92">TrimCopy</a>(TSubsc[s],Line+4,79);
  1635. <a name="l01546"></a>01546 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;Unit:&quot;</span> ,5) == 0 &amp;&amp; s &gt;= 0 &amp;&amp; s &lt; <a class="code" href="pumax_8c.html#a82714a35091aa707ef0bc4c0ad18d7b2">NUMSCALARS</a>)
  1636. <a name="l01547"></a>01547 <a class="code" href="pumax_8c.html#a328ad11792a3513df3f63cf39edd9e92">TrimCopy</a>(TSUnit[s],Line+5,79);
  1637. <a name="l01548"></a>01548 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;Scale:&quot;</span>,6) == 0 &amp;&amp; s &gt;= 0 &amp;&amp; s &lt; <a class="code" href="pumax_8c.html#a82714a35091aa707ef0bc4c0ad18d7b2">NUMSCALARS</a>)
  1638. <a name="l01549"></a>01549 <a class="code" href="pumax_8c.html#a328ad11792a3513df3f63cf39edd9e92">TrimCopy</a>(TScale[s],Line+6,79);
  1639. <a name="l01550"></a>01550
  1640. <a name="l01551"></a>01551 <span class="comment">// Attributes of parameter in change menu</span>
  1641. <a name="l01552"></a>01552
  1642. <a name="l01553"></a>01553 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;ParName:&quot;</span>,8) == 0 &amp;&amp; p &gt;= 0 &amp;&amp; p &lt; <a class="code" href="pumax_8c.html#a90b6c7836a1eb1537db72ccc21295413">PARCS</a>)
  1643. <a name="l01554"></a>01554 <a class="code" href="pumax_8c.html#a328ad11792a3513df3f63cf39edd9e92">TrimCopy</a>(<a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[p].Name,Line+8,6);
  1644. <a name="l01555"></a>01555 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;ParInc:&quot;</span> ,7) == 0 &amp;&amp; p &gt;= 0 &amp;&amp; p &lt; <a class="code" href="pumax_8c.html#a90b6c7836a1eb1537db72ccc21295413">PARCS</a>)
  1645. <a name="l01556"></a>01556 <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[p].<a class="code" href="struct_parc_struct.html#a8228d63eefa1fb42c060ab069bcf2a1b">Inc</a> = atof(Line+7);
  1646. <a name="l01557"></a>01557 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;ParMin:&quot;</span> ,7) == 0 &amp;&amp; p &gt;= 0 &amp;&amp; p &lt; <a class="code" href="pumax_8c.html#a90b6c7836a1eb1537db72ccc21295413">PARCS</a>)
  1647. <a name="l01558"></a>01558 <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[p].<a class="code" href="struct_parc_struct.html#a2a2d6960e03fa37291f0fff4402f4a38">Min</a> = atof(Line+7);
  1648. <a name="l01559"></a>01559 <span class="keywordflow">if</span> (strncmp(Line,<span class="stringliteral">&quot;ParMax:&quot;</span> ,7) == 0 &amp;&amp; p &gt;= 0 &amp;&amp; p &lt; <a class="code" href="pumax_8c.html#a90b6c7836a1eb1537db72ccc21295413">PARCS</a>)
  1649. <a name="l01560"></a>01560 <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[p].<a class="code" href="struct_parc_struct.html#a01b1f457258f82282fdeeb6d8d4fbd8b">Max</a> = atof(Line+7);
  1650. <a name="l01561"></a>01561 <span class="keywordflow">if</span> (strcmp(<a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[p].Name,<span class="stringliteral">&quot;SELLON&quot;</span>) == 0) <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[p].<a class="code" href="struct_parc_struct.html#a8228d63eefa1fb42c060ab069bcf2a1b">Inc</a> = 360.0 / (2.0 * <a class="code" href="pumax_8c.html#af601e2b0de5522e6f9acdf65e5c43bc2">Latitudes</a>);
  1651. <a name="l01562"></a>01562 }
  1652. <a name="l01563"></a>01563 fclose(fp);
  1653. <a name="l01564"></a>01564 <span class="keywordflow">return</span> 0;
  1654. <a name="l01565"></a>01565 }
  1655. <a name="l01566"></a>01566
  1656. <a name="l01567"></a>01567
  1657. <a name="l01568"></a><a class="code" href="pumax_8c.html#a32a86742844c9c69ff991885e4519233">01568</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a32a86742844c9c69ff991885e4519233">CreateControlWindow</a>(<span class="keywordtype">void</span>)
  1658. <a name="l01569"></a>01569 {
  1659. <a name="l01570"></a>01570 <span class="keywordtype">int</span> <a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a>,Y,W,H,B,D,x,y;
  1660. <a name="l01571"></a>01571 <span class="keywordtype">char</span> Title1[256];
  1661. <a name="l01572"></a>01572 <span class="keywordtype">char</span> *WinconTitle1;
  1662. <a name="l01573"></a>01573 <span class="keywordtype">char</span> *WinconTitle3 = {<span class="stringliteral">&quot;RUN finished - click on red stop button&quot;</span>};
  1663. <a name="l01574"></a>01574 Window Rootwin;
  1664. <a name="l01575"></a>01575 Window Child;
  1665. <a name="l01576"></a>01576
  1666. <a name="l01577"></a>01577 strcpy(Title1,<span class="stringliteral">&quot;Unknown model&quot;</span>);
  1667. <a name="l01578"></a>01578 <span class="keywordflow">if</span> (Model == 0) <span class="comment">// PUMA</span>
  1668. <a name="l01579"></a>01579 {
  1669. <a name="l01580"></a>01580 <span class="keywordflow">if</span> (MRpid &lt; 0)
  1670. <a name="l01581"></a>01581 strcpy(Title1,<span class="stringliteral">&quot;PUMA - KlimaCampus Hamburg&quot;</span>);
  1671. <a name="l01582"></a>01582 <span class="keywordflow">else</span>
  1672. <a name="l01583"></a>01583 sprintf(Title1,<span class="stringliteral">&quot;Run %d: PUMA - KlimaCampus Hamburg&quot;</span>,MRpid);
  1673. <a name="l01584"></a>01584 }
  1674. <a name="l01585"></a>01585 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (Model == 1) sprintf(Title1,<span class="stringliteral">&quot;SAM - KlimaCampus&quot;</span>);
  1675. <a name="l01586"></a>01586 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (Model == 2)
  1676. <a name="l01587"></a>01587 {
  1677. <a name="l01588"></a>01588 <span class="keywordflow">if</span> (MRpid &lt; 0)
  1678. <a name="l01589"></a>01589 sprintf(Title1,<span class="stringliteral">&quot;Planet Simulator (%s) - KlimaCampus&quot;</span>,PlanetName);
  1679. <a name="l01590"></a>01590 <span class="keywordflow">else</span>
  1680. <a name="l01591"></a>01591 sprintf(Title1,<span class="stringliteral">&quot;Run %d: Planet Simulator (%s) - KlimaCampus&quot;</span>,MRpid,PlanetName);
  1681. <a name="l01592"></a>01592 }
  1682. <a name="l01593"></a>01593 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (Model == 3) sprintf(Title1,<span class="stringliteral">&quot;Planet Simulator / LSG - KlimaCampus&quot;</span>);
  1683. <a name="l01594"></a>01594 <span class="keywordflow">else</span> printf(<span class="stringliteral">&quot;*** unknown model number %d in pumax ***\n&quot;</span>,Model);
  1684. <a name="l01595"></a>01595 WinconTitle1 = Title1;
  1685. <a name="l01596"></a>01596 <span class="keywordflow">if</span> (CowW &lt; 920 || CowW &gt; ScreenW) CowW = 920;
  1686. <a name="l01597"></a>01597 <span class="keywordflow">if</span> (NumWin &lt; 5) CowH = 6 * FixFontHeight + 5;
  1687. <a name="l01598"></a>01598 <span class="keywordflow">else</span> CowH = NumWin * FixFontHeight + 5;
  1688. <a name="l01599"></a>01599 <span class="keywordflow">if</span> (CowX &lt; 0 || CowX &gt; ScreenW - CowW) CowX = (ScreenW - <a class="code" href="pumax_8c.html#a4c0dc1ddfa49f758e626fbe8e5e2259e">CowW</a>) / 2;
  1689. <a name="l01600"></a>01600 <span class="keywordflow">if</span> (CowY &lt; 0 || CowY &gt; ScreenBot - CowH - WinTM - WinBM) CowY = ScreenBot - CowH - WinTM - <a class="code" href="pumax_8c.html#ad6e080222bafe5cdc477c0a8ae13d144">WinBM</a>;
  1690. <a name="l01601"></a>01601 CowSizeHints.flags = PPosition | PSize | PMinSize | PMaxSize;
  1691. <a name="l01602"></a>01602 CowSizeHints.min_width = <a class="code" href="pumax_8c.html#a4c0dc1ddfa49f758e626fbe8e5e2259e">CowW</a>;
  1692. <a name="l01603"></a>01603 CowSizeHints.min_height = <a class="code" href="pumax_8c.html#a5d560d88e396adf0394249a56c20155a">CowH</a>;
  1693. <a name="l01604"></a>01604 CowSizeHints.max_width = ScreenW - WinLM - <a class="code" href="pumax_8c.html#a261f1b75cb979500af635c616e19771d">WinRM</a>;
  1694. <a name="l01605"></a>01605 CowSizeHints.max_height = <a class="code" href="pumax_8c.html#a5d560d88e396adf0394249a56c20155a">CowH</a>;
  1695. <a name="l01606"></a>01606 <span class="keywordflow">if</span> (MRnum == 2 &amp;&amp; MRpid == 1) CowX += <a class="code" href="pumax_8c.html#a47745e91e472dc647c023d88e004f6be">ScreenW</a>;
  1696. <a name="l01607"></a>01607 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">Debug</a>) printf(<span class="stringliteral">&quot;Control Window %d/%d %dx%d\n&quot;</span>,CowX,CowY,CowW,CowH);
  1697. <a name="l01608"></a>01608 Cow = XCreateWindow(display,RootWindow(display,screen_num), <span class="comment">// display, parent</span>
  1698. <a name="l01609"></a>01609 CowX,CowY,CowW,CowH,
  1699. <a name="l01610"></a>01610 BorderWidth,CopyFromParent,InputOutput, <span class="comment">// border, depth, class</span>
  1700. <a name="l01611"></a>01611 CopyFromParent,0,NULL); <span class="comment">// visual, valuemask, attributes</span>
  1701. <a name="l01612"></a>01612 XStringListToTextProperty(&amp;WinconTitle1,1,&amp;WinconName1);
  1702. <a name="l01613"></a>01613 XStringListToTextProperty(&amp;WinconTitle3,1,&amp;WinconName3);
  1703. <a name="l01614"></a>01614 XStringListToTextProperty(&amp;PauseTitle,1,&amp;WinconPause);
  1704. <a name="l01615"></a>01615 XStringListToTextProperty(&amp;ReadyTitle,1,&amp;WinconReady);
  1705. <a name="l01616"></a>01616 XSetWMProtocols(display,Cow,&amp;Delwin,1);
  1706. <a name="l01617"></a>01617 XSetWMProperties(display,Cow,&amp;WinconName1,NULL,
  1707. <a name="l01618"></a>01618 NULL,0,&amp;CowSizeHints,&amp;wm_hints,&amp;class_hints);
  1708. <a name="l01619"></a>01619 XSelectInput(display,Cow,ButtonPressMask | KeyPressMask | ExposureMask);
  1709. <a name="l01620"></a>01620 XMapWindow(display,Cow);
  1710. <a name="l01621"></a>01621 }
  1711. <a name="l01622"></a>01622
  1712. <a name="l01623"></a>01623
  1713. <a name="l01624"></a><a class="code" href="pumax_8c.html#acf33d3bfa71c46444f4f80e09ee4b9c6">01624</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#acf33d3bfa71c46444f4f80e09ee4b9c6">ShowStep</a>(<span class="keywordtype">void</span>)
  1714. <a name="l01625"></a>01625 {
  1715. <a name="l01626"></a>01626 <span class="keywordtype">char</span> Text[80];
  1716. <a name="l01627"></a>01627 XSetFont(display, gc, BigFont-&gt;fid);
  1717. <a name="l01628"></a>01628 XSetForeground(display,gc,BlackPix);
  1718. <a name="l01629"></a>01629 XSetBackground(display,gc,Grey.pixel);
  1719. <a name="l01630"></a>01630 <a class="code" href="pumax_8c.html#a9a77522ccd12c4a90555384a383b8537">ntocdat</a>();
  1720. <a name="l01631"></a>01631 <span class="keywordflow">if</span> (ndatim[5] == 6) XSetForeground(display,gc,Red.pixel); <span class="comment">// sunday</span>
  1721. <a name="l01632"></a>01632 XDrawImageString(display,Cow,gc,10,BigFontHeight,datch,strlen(datch));
  1722. <a name="l01633"></a>01633 XSetForeground(display,gc,BlackPix);
  1723. <a name="l01634"></a>01634 <span class="keywordflow">if</span> (ShowQueue)
  1724. <a name="l01635"></a>01635 {
  1725. <a name="l01636"></a>01636 sprintf(Text,<span class="stringliteral">&quot;%8d Events &quot;</span>,XPending(display));
  1726. <a name="l01637"></a>01637 XDrawImageString(display,Cow,gc,10,60 + BigFontHeight,Text,strlen(Text));
  1727. <a name="l01638"></a>01638 }
  1728. <a name="l01639"></a>01639 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (fps &gt; 1)
  1729. <a name="l01640"></a>01640 {
  1730. <a name="l01641"></a>01641 <span class="keywordflow">if</span> (SkipFreq &lt; 2) sprintf(Text,<span class="stringliteral">&quot;%5d fps&quot;</span>,fps);
  1731. <a name="l01642"></a>01642 <span class="keywordflow">else</span> sprintf(Text,<span class="stringliteral">&quot;%5d fps [%d]&quot;</span>,fps,SkipFreq);
  1732. <a name="l01643"></a>01643 XDrawImageString(display,Cow,gc,10,60 + BigFontHeight,Text,strlen(Text));
  1733. <a name="l01644"></a>01644 }
  1734. <a name="l01645"></a>01645 }
  1735. <a name="l01646"></a>01646
  1736. <a name="l01647"></a>01647
  1737. <a name="l01648"></a><a class="code" href="pumax_8c.html#a885719e3af8b3d9a2a49ddbf00c9b27f">01648</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a885719e3af8b3d9a2a49ddbf00c9b27f">FormatVal</a>(<span class="keywordtype">char</span> *Name, <span class="keywordtype">float</span> V, <span class="keywordtype">char</span> *Text)
  1738. <a name="l01649"></a>01649 {
  1739. <a name="l01650"></a>01650 <span class="keywordtype">char</span> Format[80];
  1740. <a name="l01651"></a>01651
  1741. <a name="l01652"></a>01652 <span class="keywordflow">if</span> (V &gt; 9999.9 || V &lt; -999.9)
  1742. <a name="l01653"></a>01653 {
  1743. <a name="l01654"></a>01654 sprintf(Text,<span class="stringliteral">&quot;%6.6s = *****&quot;</span>,Name);
  1744. <a name="l01655"></a>01655 <span class="keywordflow">return</span> strlen(Text);
  1745. <a name="l01656"></a>01656 }
  1746. <a name="l01657"></a>01657 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (V &gt; 999.99 ) strcpy(Format,<span class="stringliteral">&quot;%6.6s =%6.1f&quot;</span>);
  1747. <a name="l01658"></a>01658 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (V &gt; 99.999 ) strcpy(Format,<span class="stringliteral">&quot;%6.6s =%6.2f&quot;</span>);
  1748. <a name="l01659"></a>01659 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (V &gt; 9.9999) strcpy(Format,<span class="stringliteral">&quot;%6.6s =%6.3f&quot;</span>);
  1749. <a name="l01660"></a>01660 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (V &gt; 0.0 ) strcpy(Format,<span class="stringliteral">&quot;%6.6s =%6.4f&quot;</span>);
  1750. <a name="l01661"></a>01661 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (V &gt; -9.9 ) strcpy(Format,<span class="stringliteral">&quot;%6.6s =%6.3f&quot;</span>);
  1751. <a name="l01662"></a>01662 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (V &gt; -99.9 ) strcpy(Format,<span class="stringliteral">&quot;%6.6s =%6.2f&quot;</span>);
  1752. <a name="l01663"></a>01663 <span class="keywordflow">else</span> strcpy(Format,<span class="stringliteral">&quot;%6.6s =%6.1f&quot;</span>);
  1753. <a name="l01664"></a>01664
  1754. <a name="l01665"></a>01665 sprintf(Text,Format,Name,V);
  1755. <a name="l01666"></a>01666 <span class="keywordflow">return</span> strlen(Text);
  1756. <a name="l01667"></a>01667 }
  1757. <a name="l01668"></a>01668
  1758. <a name="l01669"></a>01669
  1759. <a name="l01670"></a><a class="code" href="pumax_8c.html#a556605526426c716c92badd69589728a">01670</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a556605526426c716c92badd69589728a">ShowParcs</a>(<span class="keywordtype">void</span>)
  1760. <a name="l01671"></a>01671 {
  1761. <a name="l01672"></a>01672 <span class="keywordtype">char</span> Text[80];
  1762. <a name="l01673"></a>01673 <span class="keywordtype">int</span> len;
  1763. <a name="l01674"></a>01674 <span class="keywordtype">float</span> V;
  1764. <a name="l01675"></a>01675
  1765. <a name="l01676"></a>01676 XSetFont(display, gc, BigFont-&gt;fid);
  1766. <a name="l01677"></a>01677 len = <a class="code" href="pumax_8c.html#a885719e3af8b3d9a2a49ddbf00c9b27f">FormatVal</a>(<a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[cpi].Name,<a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[cpi].Val,Text);
  1767. <a name="l01678"></a>01678
  1768. <a name="l01679"></a>01679 XSetBackground(display,gc,WhitePix);
  1769. <a name="l01680"></a>01680 XSetForeground(display,gc,Red.pixel);
  1770. <a name="l01681"></a>01681 XFillRectangle(display,Cow,gc,Minus_XL,Minus_YL,Minus_XH-Minus_XL,Minus_YH-Minus_YL);
  1771. <a name="l01682"></a>01682 XFillRectangle(display,Cow,gc,FBWD_XL,FBWD_YL,FBWD_XH-FBWD_XL,FBWD_YH-FBWD_YL);
  1772. <a name="l01683"></a>01683 XSetForeground(display,gc,WhitePix);
  1773. <a name="l01684"></a>01684 XFillRectangle(display,Cow,gc,Minus_XL+3,(Minus_YH+Minus_YL)/2-1,Minus_XH-Minus_XL-5,3);
  1774. <a name="l01685"></a>01685 XFillRectangle(display,Cow,gc,FBWD_XL+3,(FBWD_YH+FBWD_YL)/2-1,FBWD_XH-FBWD_XL-5,3);
  1775. <a name="l01686"></a>01686 XSetForeground(display,gc,BlackPix);
  1776. <a name="l01687"></a>01687 XDrawImageString(display,Cow,gc,Parc_XL,Parc_YH-3,Text,len);
  1777. <a name="l01688"></a>01688 XSetForeground(display,gc,Green.pixel);
  1778. <a name="l01689"></a>01689 XFillRectangle(display,Cow,gc,Plus_XL,Plus_YL,Plus_XH-Plus_XL,Plus_YH-Plus_YL);
  1779. <a name="l01690"></a>01690 XFillRectangle(display,Cow,gc,FFWD_XL,FFWD_YL,FFWD_XH-FFWD_XL,FFWD_YH-FFWD_YL);
  1780. <a name="l01691"></a>01691 XSetForeground(display,gc,WhitePix);
  1781. <a name="l01692"></a>01692 XFillRectangle(display,Cow,gc,Plus_XL+3,(Plus_YH+Plus_YL)/2-1,Plus_XH-Plus_XL-5,3);
  1782. <a name="l01693"></a>01693 XFillRectangle(display,Cow,gc,FFWD_XL+3,(FFWD_YH+FFWD_YL)/2-1,FFWD_XH-FFWD_XL-5,3);
  1783. <a name="l01694"></a>01694 XFillRectangle(display,Cow,gc,(Plus_XH+Plus_XL)/2-1,Plus_YL+3,3,Plus_YH-Plus_YL-5);
  1784. <a name="l01695"></a>01695 XFillRectangle(display,Cow,gc,(FFWD_XH+FFWD_XL)/2-1,FFWD_YL+3,3,FFWD_YH-FFWD_YL-5);
  1785. <a name="l01696"></a>01696 XSetForeground(display,gc,BlackPix);
  1786. <a name="l01697"></a>01697 XDrawRectangle(display,Cow,gc,Minus_XL,Minus_YL,Minus_XH-Minus_XL,Minus_YH-Minus_YL);
  1787. <a name="l01698"></a>01698 XDrawRectangle(display,Cow,gc,FBWD_XL,FBWD_YL,FBWD_XH-FBWD_XL,FBWD_YH-FBWD_YL);
  1788. <a name="l01699"></a>01699 XDrawRectangle(display,Cow,gc,Parc_XL-1,Parc_YL-1,Parc_XH-Parc_XL+1,Parc_YH-Parc_YL);
  1789. <a name="l01700"></a>01700 XDrawRectangle(display,Cow,gc,Plus_XL,Plus_YL,Plus_XH-Plus_XL,Plus_YH-Plus_YL);
  1790. <a name="l01701"></a>01701 XDrawRectangle(display,Cow,gc,FFWD_XL,FFWD_YL,FFWD_XH-FFWD_XL,FFWD_YH-FFWD_YL);
  1791. <a name="l01702"></a>01702
  1792. <a name="l01703"></a>01703 <span class="comment">/* Show next parameter */</span>
  1793. <a name="l01704"></a>01704
  1794. <a name="l01705"></a>01705 strcpy(Text,<span class="stringliteral">&quot; &quot;</span>);
  1795. <a name="l01706"></a>01706 <span class="keywordflow">if</span> (cpi &lt; Parcs-1) <a class="code" href="pumax_8c.html#a885719e3af8b3d9a2a49ddbf00c9b27f">FormatVal</a>(<a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[cpi+1].Name,<a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[cpi+1].Val,Text);
  1796. <a name="l01707"></a>01707 len = strlen(Text);
  1797. <a name="l01708"></a>01708
  1798. <a name="l01709"></a>01709 XSetBackground(display,gc,WhitePix);
  1799. <a name="l01710"></a>01710 XSetForeground(display,gc,BlackPix);
  1800. <a name="l01711"></a>01711 XDrawImageString(display,Cow,gc,Parc_XL,2*Parc_YH-Parc_YL-3,Text,len);
  1801. <a name="l01712"></a>01712 XDrawRectangle(display,Cow,gc,Parc_XL-1,Parc_YH-1,Parc_XH-Parc_XL+1,Parc_YH-Parc_YL);
  1802. <a name="l01713"></a>01713
  1803. <a name="l01714"></a>01714 <span class="comment">/* Show previous parameter */</span>
  1804. <a name="l01715"></a>01715
  1805. <a name="l01716"></a>01716 strcpy(Text,<span class="stringliteral">&quot; &quot;</span>);
  1806. <a name="l01717"></a>01717 <span class="keywordflow">if</span> (cpi &gt; 0) <a class="code" href="pumax_8c.html#a885719e3af8b3d9a2a49ddbf00c9b27f">FormatVal</a>(<a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[cpi-1].Name,<a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[cpi-1].Val,Text);
  1807. <a name="l01718"></a>01718 len = strlen(Text);
  1808. <a name="l01719"></a>01719
  1809. <a name="l01720"></a>01720 XSetBackground(display,gc,WhitePix);
  1810. <a name="l01721"></a>01721 XSetForeground(display,gc,BlackPix);
  1811. <a name="l01722"></a>01722 XDrawImageString(display,Cow,gc,Parc_XL,Parc_YL-3,Text,len);
  1812. <a name="l01723"></a>01723 XDrawRectangle(display,Cow,gc,Parc_XL-1,2*Parc_YL-Parc_YH-1,Parc_XH-Parc_XL+1,Parc_YH-Parc_YL);
  1813. <a name="l01724"></a>01724 XSetFont(display, gc, FixFont-&gt;fid);
  1814. <a name="l01725"></a>01725
  1815. <a name="l01726"></a>01726 }
  1816. <a name="l01727"></a>01727
  1817. <a name="l01728"></a>01728
  1818. <a name="l01729"></a><a class="code" href="pumax_8c.html#acc97da61b92440dd0e1d283db21536c0">01729</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#acc97da61b92440dd0e1d283db21536c0">CheckMark</a>(<span class="keywordtype">int</span> x, <span class="keywordtype">int</span> y, <span class="keywordtype">int</span> <a class="code" href="struct_map_image_struct.html#aef0d9e2ef28e765f15559ff077d9fe26">d</a>)
  1819. <a name="l01730"></a>01730 {
  1820. <a name="l01731"></a>01731 XDrawLine(display,Cow,gc,x+2,y+2,x+d-1,y+d-1);
  1821. <a name="l01732"></a>01732 XDrawLine(display,Cow,gc,x+3,y+2,x+d-1,y+d-2);
  1822. <a name="l01733"></a>01733 XDrawLine(display,Cow,gc,x+2,y+3,x+d-2,y+d-1);
  1823. <a name="l01734"></a>01734
  1824. <a name="l01735"></a>01735 XDrawLine(display,Cow,gc,x+d-1,y+1,x+2,y+d-2);
  1825. <a name="l01736"></a>01736 XDrawLine(display,Cow,gc,x+d-2,y+1,x+2,y+d-3);
  1826. <a name="l01737"></a>01737 XDrawLine(display,Cow,gc,x+d-1,y+2,x+3,y+d-2);
  1827. <a name="l01738"></a>01738 }
  1828. <a name="l01739"></a>01739
  1829. <a name="l01740"></a>01740
  1830. <a name="l01741"></a><a class="code" href="pumax_8c.html#a49d7de013de4c527a1bc7d1db4ea07d2">01741</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a49d7de013de4c527a1bc7d1db4ea07d2">ShowWindowStatus</a>(<span class="keywordtype">void</span>)
  1831. <a name="l01742"></a>01742 {
  1832. <a name="l01743"></a>01743 <span class="keywordtype">char</span> *cp;
  1833. <a name="l01744"></a>01744 <span class="keywordtype">char</span> Text[80];
  1834. <a name="l01745"></a>01745 <span class="keywordtype">int</span> len,<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>,x,<a class="code" href="struct_map_image_struct.html#aef0d9e2ef28e765f15559ff077d9fe26">d</a>;
  1835. <a name="l01746"></a>01746
  1836. <a name="l01747"></a>01747 XSetFont(display, gc, FixFont-&gt;fid);
  1837. <a name="l01748"></a>01748 XSetForeground(display,gc,BlackPix);
  1838. <a name="l01749"></a>01749 XSetBackground(display,gc,Grey.pixel);
  1839. <a name="l01750"></a>01750 x = <a class="code" href="pumax_8c.html#a34c9aca7c9d3e891e823db12a7521fe2">Wbox_XL</a>;
  1840. <a name="l01751"></a>01751 d = <a class="code" href="pumax_8c.html#add5a8c33565a2bbcf55996cccc7a434b">FixFontHeight</a>;
  1841. <a name="l01752"></a>01752 <span class="keywordflow">for</span> (w=0 ; w &lt; <a class="code" href="pumax_8c.html#a2364498cd60ebd2201eeef32ce76e882">NumWin</a> ; ++<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>)
  1842. <a name="l01753"></a>01753 {
  1843. <a name="l01754"></a>01754 strncpy(Text,WindowTitle[w]+wto,40);
  1844. <a name="l01755"></a>01755 Text[40] = 0;
  1845. <a name="l01756"></a>01756 cp = strstr(Text,<span class="stringliteral">&quot;Level&quot;</span>);
  1846. <a name="l01757"></a>01757 <span class="keywordflow">if</span> (cp) *cp = 0;
  1847. <a name="l01758"></a>01758 cp = strstr(Text,<span class="stringliteral">&quot;Latitude&quot;</span>);
  1848. <a name="l01759"></a>01759 <span class="keywordflow">if</span> (cp) *cp = 0;
  1849. <a name="l01760"></a>01760 len = strlen(Text);
  1850. <a name="l01761"></a>01761 XDrawImageString(display,Cow,gc,x+20,(w+1) * d,Text,len);
  1851. <a name="l01762"></a>01762 }
  1852. <a name="l01763"></a>01763 XSetForeground(display,gc,WhitePix);
  1853. <a name="l01764"></a>01764 <span class="keywordflow">for</span> (w=0 ; w &lt; <a class="code" href="pumax_8c.html#a2364498cd60ebd2201eeef32ce76e882">NumWin</a> ; ++<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>)
  1854. <a name="l01765"></a>01765 {
  1855. <a name="l01766"></a>01766 XFillRectangle(display,Cow,gc,x,w*d,d,d);
  1856. <a name="l01767"></a>01767 }
  1857. <a name="l01768"></a>01768 XSetForeground(display,gc,BlackPix);
  1858. <a name="l01769"></a>01769 <span class="keywordflow">for</span> (w=0 ; w &lt; <a class="code" href="pumax_8c.html#a2364498cd60ebd2201eeef32ce76e882">NumWin</a> ; ++<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>)
  1859. <a name="l01770"></a>01770 {
  1860. <a name="l01771"></a>01771 XDrawRectangle(display,Cow,gc,x,w*d,d,d);
  1861. <a name="l01772"></a>01772 }
  1862. <a name="l01773"></a>01773 <span class="keywordflow">for</span> (w=0 ; w &lt; <a class="code" href="pumax_8c.html#a2364498cd60ebd2201eeef32ce76e882">NumWin</a> ; ++<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a>)
  1863. <a name="l01774"></a>01774 <span class="keywordflow">if</span> (Win[w]) <a class="code" href="pumax_8c.html#acc97da61b92440dd0e1d283db21536c0">CheckMark</a>(x,w*d,d);
  1864. <a name="l01775"></a>01775 }
  1865. <a name="l01776"></a>01776
  1866. <a name="l01777"></a>01777
  1867. <a name="l01778"></a><a class="code" href="pumax_8c.html#a2ddd057b95fbe6c728ffa0675b8d079f">01778</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a2ddd057b95fbe6c728ffa0675b8d079f">ShowGridStatus</a>(<span class="keywordtype">void</span>)
  1868. <a name="l01779"></a>01779 {
  1869. <a name="l01780"></a>01780 <span class="keywordtype">int</span> x,y,<a class="code" href="struct_map_image_struct.html#aef0d9e2ef28e765f15559ff077d9fe26">d</a>;
  1870. <a name="l01781"></a>01781
  1871. <a name="l01782"></a>01782 d = <a class="code" href="pumax_8c.html#add5a8c33565a2bbcf55996cccc7a434b">FixFontHeight</a>;
  1872. <a name="l01783"></a>01783 x = <a class="code" href="pumax_8c.html#adbf17b3e938de11e352f68acd0273ada">Grid_XL</a>;
  1873. <a name="l01784"></a>01784 y = <a class="code" href="pumax_8c.html#af60996257395d9ddc45200ad8dd9a4ae">Grid_YL</a>;
  1874. <a name="l01785"></a>01785 XSetFont(display, gc, FixFont-&gt;fid);
  1875. <a name="l01786"></a>01786 XSetForeground(display,gc,BlackPix);
  1876. <a name="l01787"></a>01787 XSetBackground(display,gc,Grey.pixel);
  1877. <a name="l01788"></a>01788 XDrawImageString(display,Cow,gc,Grid_XH+FixFontWidth,Grid_YH,<span class="stringliteral">&quot;Grid&quot;</span>,4);
  1878. <a name="l01789"></a>01789 XSetForeground(display,gc,WhitePix);
  1879. <a name="l01790"></a>01790 XFillRectangle(display,Cow,gc,x,Grid_YL,d,d);
  1880. <a name="l01791"></a>01791 XSetForeground(display,gc,BlackPix);
  1881. <a name="l01792"></a>01792 XDrawRectangle(display,Cow,gc,x,Grid_YL,d,d);
  1882. <a name="l01793"></a>01793
  1883. <a name="l01794"></a>01794 <span class="keywordflow">if</span> (Grid) <a class="code" href="pumax_8c.html#acc97da61b92440dd0e1d283db21536c0">CheckMark</a>(x,y,d);
  1884. <a name="l01795"></a>01795 }
  1885. <a name="l01796"></a>01796
  1886. <a name="l01797"></a>01797
  1887. <a name="l01798"></a><a class="code" href="pumax_8c.html#a41f77efa657ce06e158034152384bf2e">01798</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a41f77efa657ce06e158034152384bf2e">RedrawControlWindow</a>(<span class="keywordtype">void</span>)
  1888. <a name="l01799"></a>01799 {
  1889. <a name="l01800"></a>01800 <span class="keywordtype">char</span> Text[80];
  1890. <a name="l01801"></a>01801 <span class="keywordtype">int</span> status,<a class="code" href="pumax_8c.html#a90fa18336f52663513916236b6c3f633">WinXSize</a>,<a class="code" href="pumax_8c.html#a48ba2c20a7bf82da8f16252eff21155f">WinYSize</a>,font_height,width,len;
  1891. <a name="l01802"></a>01802 <span class="keywordtype">int</span> i,j,x1,x2,y1,y2,y3;
  1892. <a name="l01803"></a>01803 XWindowAttributes CurAtt;
  1893. <a name="l01804"></a>01804
  1894. <a name="l01805"></a>01805 status = XGetWindowAttributes(display,Cow,&amp;CurAtt);
  1895. <a name="l01806"></a>01806 WinXSize = CurAtt.width;
  1896. <a name="l01807"></a>01807 WinYSize = CurAtt.height;
  1897. <a name="l01808"></a>01808
  1898. <a name="l01809"></a>01809 XSetForeground(display,gc,BlackPix);
  1899. <a name="l01810"></a>01810 XSetBackground(display,gc,WhitePix);
  1900. <a name="l01811"></a>01811
  1901. <a name="l01812"></a>01812 XSetWindowBackground(display,Cow,Grey.pixel);
  1902. <a name="l01813"></a>01813 XClearWindow(display,Cow);
  1903. <a name="l01814"></a>01814
  1904. <a name="l01815"></a>01815 <span class="comment">/* Red stop button */</span>
  1905. <a name="l01816"></a>01816
  1906. <a name="l01817"></a>01817 XSetForeground(display,gc,Red.pixel);
  1907. <a name="l01818"></a>01818 XFillPolygon(display,Cow,gc,StopButton,4,Convex,CoordModeOrigin);
  1908. <a name="l01819"></a>01819 XSetForeground(display,gc,WhitePix);
  1909. <a name="l01820"></a>01820 x1 = StopButton[0].x ;
  1910. <a name="l01821"></a>01821 y1 = StopButton[0].y ;
  1911. <a name="l01822"></a>01822 <span class="keywordflow">for</span> (j=0 ; j &lt; <a class="code" href="pumax_8c.html#ac94f19a0578e5b444225233739749082">PSDIM</a> ; ++j)
  1912. <a name="l01823"></a>01823 <span class="keywordflow">for</span> (i=0 ; i &lt; <a class="code" href="pumax_8c.html#ac94f19a0578e5b444225233739749082">PSDIM</a> ; ++i)
  1913. <a name="l01824"></a>01824 <span class="keywordflow">if</span> (pixelstar[j][i] == <span class="charliteral">&#39;*&#39;</span>)
  1914. <a name="l01825"></a>01825 XDrawPoint(display,Cow,gc,i+x1,j+y1);
  1915. <a name="l01826"></a>01826
  1916. <a name="l01827"></a>01827 XSetForeground(display,gc,LightRed.pixel);
  1917. <a name="l01828"></a>01828 x1 = 10; x2 = 40 ; y1 = OffsetY + 10 ; y2 = OffsetY + 40;
  1918. <a name="l01829"></a>01829 XDrawLine(display,Cow,gc,x2 ,y1-1,x2 ,y2 );
  1919. <a name="l01830"></a>01830 XDrawLine(display,Cow,gc,x2+1,y1-2,x2+1,y2+1);
  1920. <a name="l01831"></a>01831 XDrawLine(display,Cow,gc,x1-1,y1-1,x2 ,y1-1);
  1921. <a name="l01832"></a>01832 XDrawLine(display,Cow,gc,x2+1,y2-2,x2+1,y1-2);
  1922. <a name="l01833"></a>01833 XSetForeground(display,gc,DarkRed.pixel);
  1923. <a name="l01834"></a>01834 XDrawLine(display,Cow,gc,x1-1,y1-1,x1-1,y2 );
  1924. <a name="l01835"></a>01835 XDrawLine(display,Cow,gc,x1-2,y1-2,x1-2,y2+1);
  1925. <a name="l01836"></a>01836 XDrawLine(display,Cow,gc,x1-1,y2 ,x2 ,y2 );
  1926. <a name="l01837"></a>01837 XDrawLine(display,Cow,gc,x1-2,y2+1,x2+1,y2+1);
  1927. <a name="l01838"></a>01838
  1928. <a name="l01839"></a>01839 <span class="comment">// Green &lt;play&gt; button</span>
  1929. <a name="l01840"></a>01840
  1930. <a name="l01841"></a>01841 XSetForeground(display,gc,Green.pixel);
  1931. <a name="l01842"></a>01842 XFillPolygon(display,Cow,gc,StartButton,3,Convex,CoordModeOrigin);
  1932. <a name="l01843"></a>01843 x1 = 50; x2 = 80 ; y1 = OffsetY + 10 ; y2 = OffsetY + 25; y3 = OffsetY + 40;
  1933. <a name="l01844"></a>01844 XSetForeground(display,gc,LightGreen.pixel);
  1934. <a name="l01845"></a>01845 XDrawLine(display,Cow,gc,x1 ,y1-1,x2 ,y2 );
  1935. <a name="l01846"></a>01846 XDrawLine(display,Cow,gc,x1 ,y1-2,x2+1,y2 );
  1936. <a name="l01847"></a>01847 XSetForeground(display,gc,DarkGreen.pixel);
  1937. <a name="l01848"></a>01848 XDrawLine(display,Cow,gc,x1-1,y1-1,x1-1,y3+1);
  1938. <a name="l01849"></a>01849 XDrawLine(display,Cow,gc,x1-2,y1-2,x1-2,y3+2);
  1939. <a name="l01850"></a>01850
  1940. <a name="l01851"></a>01851 <span class="comment">// Blue &lt;pause&gt; button</span>
  1941. <a name="l01852"></a>01852
  1942. <a name="l01853"></a>01853 XSetForeground(display,gc,Blue.pixel);
  1943. <a name="l01854"></a>01854 XFillPolygon(display,Cow,gc,PauseButton1,4,Convex,CoordModeOrigin);
  1944. <a name="l01855"></a>01855 XFillPolygon(display,Cow,gc,PauseButton2,4,Convex,CoordModeOrigin);
  1945. <a name="l01856"></a>01856
  1946. <a name="l01857"></a>01857 x1 = 95; x2 = 102; y1 = OffsetY + 10; y2 = OffsetY + 40;
  1947. <a name="l01858"></a>01858 XSetForeground(display,gc,DarkBlue.pixel);
  1948. <a name="l01859"></a>01859 XDrawLine(display,Cow,gc,x1-1,y1-1,x1-1,y2 );
  1949. <a name="l01860"></a>01860 XDrawLine(display,Cow,gc,x1-2,y1-2,x1-2,y2+1);
  1950. <a name="l01861"></a>01861 XDrawLine(display,Cow,gc,x1-1,y2 ,x2 ,y2 );
  1951. <a name="l01862"></a>01862 XDrawLine(display,Cow,gc,x1-2,y2+1,x2+1,y2+1);
  1952. <a name="l01863"></a>01863 XSetForeground(display,gc,LightBlue.pixel);
  1953. <a name="l01864"></a>01864 XDrawLine(display,Cow,gc,x2 ,y1-1,x2 ,y2 );
  1954. <a name="l01865"></a>01865 XDrawLine(display,Cow,gc,x2+1,y1-2,x2+1,y2+1);
  1955. <a name="l01866"></a>01866 XDrawLine(display,Cow,gc,x1-1,y1-1,x2 ,y1-1);
  1956. <a name="l01867"></a>01867 XDrawLine(display,Cow,gc,x2+1,y2-2,x2+1,y1-2);
  1957. <a name="l01868"></a>01868
  1958. <a name="l01869"></a>01869 x1 = 108; x2 = 115; y1 = OffsetY + 10; y2 = OffsetY + 40;
  1959. <a name="l01870"></a>01870 XSetForeground(display,gc,DarkBlue.pixel);
  1960. <a name="l01871"></a>01871 XDrawLine(display,Cow,gc,x1-1,y1-1,x1-1,y2 );
  1961. <a name="l01872"></a>01872 XDrawLine(display,Cow,gc,x1-2,y1-2,x1-2,y2+1);
  1962. <a name="l01873"></a>01873 XDrawLine(display,Cow,gc,x1-1,y2 ,x2 ,y2 );
  1963. <a name="l01874"></a>01874 XDrawLine(display,Cow,gc,x1-2,y2+1,x2+1,y2+1);
  1964. <a name="l01875"></a>01875 XSetForeground(display,gc,LightBlue.pixel);
  1965. <a name="l01876"></a>01876 XDrawLine(display,Cow,gc,x2 ,y1-1,x2 ,y2 );
  1966. <a name="l01877"></a>01877 XDrawLine(display,Cow,gc,x2+1,y1-2,x2+1,y2+1);
  1967. <a name="l01878"></a>01878 XDrawLine(display,Cow,gc,x1-1,y1-1,x2 ,y1-1);
  1968. <a name="l01879"></a>01879 XDrawLine(display,Cow,gc,x2+1,y2-2,x2+1,y1-2);
  1969. <a name="l01880"></a>01880
  1970. <a name="l01881"></a>01881 <span class="comment">// Help button</span>
  1971. <a name="l01882"></a>01882
  1972. <a name="l01883"></a>01883 x1 = 200; x2 = x1 + 5 * <a class="code" href="pumax_8c.html#aefafab89c009b3e4258f1216ae91e76c">BigFontWidth</a>; y1 = OffsetY + 10; y2 = y1 + 30;
  1973. <a name="l01884"></a>01884 XSetForeground(display,gc,Red.pixel);
  1974. <a name="l01885"></a>01885 XFillRectangle(display,Cow,gc,x1,y1,x2-x1,y2-y1);
  1975. <a name="l01886"></a>01886 XSetForeground(display,gc,BlackPix);
  1976. <a name="l01887"></a>01887 XDrawRectangle(display,Cow,gc,x1-1,y1-1,x2-x1+1,y2-y1+1);
  1977. <a name="l01888"></a>01888 XSetFont(display,gc,BigFont-&gt;fid);
  1978. <a name="l01889"></a>01889 XSetForeground(display,gc,Yellow.pixel);
  1979. <a name="l01890"></a>01890 XSetBackground(display,gc,Red.pixel);
  1980. <a name="l01891"></a>01891 XDrawImageString(display,Cow,gc,x1+BigFontWidth/2,(y1+y2)/2+BigFont-&gt;ascent/2,<span class="stringliteral">&quot;HELP&quot;</span>,4);
  1981. <a name="l01892"></a>01892
  1982. <a name="l01893"></a>01893 <a class="code" href="pumax_8c.html#acf33d3bfa71c46444f4f80e09ee4b9c6">ShowStep</a>();
  1983. <a name="l01894"></a>01894 <a class="code" href="pumax_8c.html#a556605526426c716c92badd69589728a">ShowParcs</a>();
  1984. <a name="l01895"></a>01895 <a class="code" href="pumax_8c.html#a49d7de013de4c527a1bc7d1db4ea07d2">ShowWindowStatus</a>();
  1985. <a name="l01896"></a>01896 <a class="code" href="pumax_8c.html#a2ddd057b95fbe6c728ffa0675b8d079f">ShowGridStatus</a>();
  1986. <a name="l01897"></a>01897 <span class="keywordflow">return</span> 0;
  1987. <a name="l01898"></a>01898 }
  1988. <a name="l01899"></a>01899
  1989. <a name="l01900"></a>01900
  1990. <a name="l01901"></a><a class="code" href="pumax_8c.html#af2e92313aaf18974c4fa6c1cb34cd7a3">01901</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#af2e92313aaf18974c4fa6c1cb34cd7a3">ClearTracer</a>(<span class="keywordtype">void</span>)
  1991. <a name="l01902"></a>01902 {
  1992. <a name="l01903"></a>01903 <span class="keywordtype">int</span> j;
  1993. <a name="l01904"></a>01904 <span class="keywordflow">for</span> (j=0 ; j &lt; <a class="code" href="pumax_8c.html#ab5a0dcea45727946af71ece4d11e0278">MAXPAR</a> ; ++j)
  1994. <a name="l01905"></a>01905 {
  1995. <a name="l01906"></a>01906 pax[j] = -1.0;
  1996. <a name="l01907"></a>01907 pay[j] = -1.0;
  1997. <a name="l01908"></a>01908 }
  1998. <a name="l01909"></a>01909 }
  1999. <a name="l01910"></a>01910
  2000. <a name="l01911"></a>01911
  2001. <a name="l01912"></a><a class="code" href="pumax_8c.html#a03fae160cac537852ccd95f3670a339a">01912</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a03fae160cac537852ccd95f3670a339a">CheckEndianess</a>(<span class="keywordtype">void</span>)
  2002. <a name="l01913"></a>01913 {
  2003. <a name="l01914"></a>01914 <span class="keyword">union </span>EndianCheck
  2004. <a name="l01915"></a>01915 {
  2005. <a name="l01916"></a>01916 <span class="keywordtype">char</span> b[<span class="keyword">sizeof</span>(int)];
  2006. <a name="l01917"></a>01917 <span class="keywordtype">int</span> i;
  2007. <a name="l01918"></a>01918 } ec;
  2008. <a name="l01919"></a>01919
  2009. <a name="l01920"></a>01920 ec.i = 8;
  2010. <a name="l01921"></a>01921 <span class="keywordflow">return</span> (ec.b[0] == 0);
  2011. <a name="l01922"></a>01922 }
  2012. <a name="l01923"></a>01923
  2013. <a name="l01924"></a>01924
  2014. <a name="l01925"></a><a class="code" href="pumax_8c.html#a3112b5a95104da13f9d136d080a9571a">01925</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a3112b5a95104da13f9d136d080a9571a">initgui_</a>(<span class="keywordtype">int</span> *model, <span class="keywordtype">int</span> *debug, <span class="keywordtype">int</span> *lats, <span class="keywordtype">int</span> *mrpid, <span class="keywordtype">int</span> *mrnum)
  2015. <a name="l01926"></a>01926 {
  2016. <a name="l01927"></a>01927 <span class="keywordtype">int</span> x,y,w,h;
  2017. <a name="l01928"></a>01928 <span class="keywordtype">int</span> argc = 1;
  2018. <a name="l01929"></a>01929 <span class="keywordtype">int</span> i,j;
  2019. <a name="l01930"></a>01930 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> valuemask = 0; <span class="comment">/* ignore XGCvalues and use defaults */</span>
  2020. <a name="l01931"></a>01931 XGCValues values;
  2021. <a name="l01932"></a>01932 XEvent Event;
  2022. <a name="l01933"></a>01933 <span class="keyword">struct </span>timeval TimeVal;
  2023. <a name="l01934"></a>01934
  2024. <a name="l01935"></a>01935 <span class="comment">// Check for big endian computer</span>
  2025. <a name="l01936"></a>01936 <span class="comment">// The bitmap format &quot;.bmp&quot; ist little endian</span>
  2026. <a name="l01937"></a>01937
  2027. <a name="l01938"></a>01938 BigEndian = <a class="code" href="pumax_8c.html#a03fae160cac537852ccd95f3670a339a">CheckEndianess</a>();
  2028. <a name="l01939"></a>01939
  2029. <a name="l01940"></a>01940 <span class="comment">// Set seed for random number generator from clock</span>
  2030. <a name="l01941"></a>01941
  2031. <a name="l01942"></a>01942 gettimeofday(&amp;TimeVal,NULL);
  2032. <a name="l01943"></a>01943 Seed = TimeVal.tv_sec;
  2033. <a name="l01944"></a>01944
  2034. <a name="l01945"></a>01945 Model = *model;
  2035. <a name="l01946"></a>01946 <a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">Debug</a> = *debug;
  2036. <a name="l01947"></a>01947 Latitudes = *lats;
  2037. <a name="l01948"></a>01948 MRpid = *mrpid;
  2038. <a name="l01949"></a>01949 MRnum = *mrnum;
  2039. <a name="l01950"></a>01950
  2040. <a name="l01951"></a>01951 <span class="keywordflow">if</span> (MRpid &gt;= 0)
  2041. <a name="l01952"></a>01952 {
  2042. <a name="l01953"></a>01953 sprintf(wtrun,<span class="stringliteral">&quot;[%d] &quot;</span>,MRpid);
  2043. <a name="l01954"></a>01954 wto = strlen(wtrun);
  2044. <a name="l01955"></a>01955 }
  2045. <a name="l01956"></a>01956
  2046. <a name="l01957"></a>01957 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">Debug</a>) printf(<span class="stringliteral">&quot;initgui(%d,%d)\n&quot;</span>,Model,<a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">Debug</a>);
  2047. <a name="l01958"></a>01958 <span class="keywordflow">if</span> ((display=XOpenDisplay(display_name)) == NULL)
  2048. <a name="l01959"></a>01959 {
  2049. <a name="l01960"></a>01960 fprintf(stderr,<span class="stringliteral">&quot;%s: cannot connect to X server %s\n&quot;</span>,
  2050. <a name="l01961"></a>01961 progname, XDisplayName(display_name));
  2051. <a name="l01962"></a>01962 exit(1);
  2052. <a name="l01963"></a>01963 }
  2053. <a name="l01964"></a>01964 screen_num = DefaultScreen(display);
  2054. <a name="l01965"></a>01965 ScreenD = XDefaultDepth(display,screen_num);
  2055. <a name="l01966"></a>01966 ScreenW = DisplayWidth (display,screen_num);
  2056. <a name="l01967"></a>01967 ScreenH = DisplayHeight(display,screen_num);
  2057. <a name="l01968"></a>01968 BlackPix = BlackPixel(display,screen_num);
  2058. <a name="l01969"></a>01969 WhitePix = WhitePixel(display,screen_num);
  2059. <a name="l01970"></a>01970 SmallScreen = ScreenH &lt;= 768;
  2060. <a name="l01971"></a>01971 <span class="keywordflow">if</span> (SmallScreen)
  2061. <a name="l01972"></a>01972 {
  2062. <a name="l01973"></a>01973 WinRows = 2;
  2063. <a name="l01974"></a>01974 NumWin = WinCols * <a class="code" href="pumax_8c.html#ab109c22b7def164d1136cb9ceb9f6819">WinRows</a>;
  2064. <a name="l01975"></a>01975 Grid = 0;
  2065. <a name="l01976"></a>01976 }
  2066. <a name="l01977"></a>01977
  2067. <a name="l01978"></a>01978 <span class="keywordflow">if</span> (MRnum == 2) ScreenW /= 2; <span class="comment">/* Run with two GUI&#39;s */</span>
  2068. <a name="l01979"></a>01979
  2069. <a name="l01980"></a>01980 <span class="comment">/* Fix defaults for multihead displays */</span>
  2070. <a name="l01981"></a>01981
  2071. <a name="l01982"></a>01982 <span class="keywordflow">if</span> (ScreenH &gt; ScreenW &amp;&amp; ScreenH &gt; 1200) ScreenH = 1200;
  2072. <a name="l01983"></a>01983 <span class="keywordflow">if</span> (ScreenW &gt; 2 * ScreenH &amp;&amp; ScreenW &gt;= 2048) ScreenW /= 2;
  2073. <a name="l01984"></a>01984
  2074. <a name="l01985"></a>01985 <span class="keywordflow">for</span> (i = 0 ; i &lt; <a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a> ; ++i)
  2075. <a name="l01986"></a>01986 {
  2076. <a name="l01987"></a>01987 WindowTitle[i] = <a class="code" href="pumax_8c.html#af4c16744d5918311b39441909c66c69c">CharAlloc</a>(256,<span class="stringliteral">&quot;WindowTitle&quot;</span>);
  2077. <a name="l01988"></a>01988 <span class="keywordflow">if</span> (wto == 0) sprintf(WindowTitle[i],<span class="stringliteral">&quot;Window %d&quot;</span>,i+1);
  2078. <a name="l01989"></a>01989 <span class="keywordflow">else</span> sprintf(WindowTitle[i],<span class="stringliteral">&quot;%sWindow %d&quot;</span>,wtrun,i+1);
  2079. <a name="l01990"></a>01990 <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[i].<a class="code" href="struct_win_att_struct.html#aa00d94640c9eb39ceac56f95c595f62a">x</a> = -1;
  2080. <a name="l01991"></a>01991 <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[i].<a class="code" href="struct_win_att_struct.html#a770cabf1d350db5890f636ccf30e5d47">y</a> = -1;
  2081. <a name="l01992"></a>01992 <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[i].<a class="code" href="struct_win_att_struct.html#a6e7f8041c23d41b7d2835a2b855d35f0">w</a> = -1;
  2082. <a name="l01993"></a>01993 <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[i].<a class="code" href="struct_win_att_struct.html#aa9c1c94dee4ebbe95eb392f738835055">h</a> = -1;
  2083. <a name="l01994"></a>01994 <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[i].<a class="code" href="struct_win_att_struct.html#abd4485f9d84ad074c80fc4127922cb19">active</a> = 1;
  2084. <a name="l01995"></a>01995 }
  2085. <a name="l01996"></a>01996
  2086. <a name="l01997"></a>01997 <a class="code" href="pumax_8c.html#a12ad38f5f4aa5d1e7bce98e305662e3b">CreateTestWindow</a>();
  2087. <a name="l01998"></a>01998
  2088. <a name="l01999"></a>01999 <span class="keywordflow">if</span> (MRpid &gt;= 0) sprintf(GUI_default,<span class="stringliteral">&quot;GUI_%2.2d.cfg&quot;</span>,MRpid);
  2089. <a name="l02000"></a>02000 <a class="code" href="pumax_8c.html#ad40ddde2f8d2265ae3fd119645f85603">ReadConfig</a>(GUI_default);
  2090. <a name="l02001"></a>02001 <span class="keywordflow">if</span> (MRpid &gt;= 0) sprintf(GUI_config,<span class="stringliteral">&quot;GUI_last_used_%2.2d.cfg&quot;</span>,MRpid);
  2091. <a name="l02002"></a>02002 <a class="code" href="pumax_8c.html#ad40ddde2f8d2265ae3fd119645f85603">ReadConfig</a>(GUI_config);
  2092. <a name="l02003"></a>02003
  2093. <a name="l02004"></a>02004 <a class="code" href="pumax_8c.html#a51c0b8738867e745ec3ebd94e879f08f">LoadFonts</a>();
  2094. <a name="l02005"></a>02005 <a class="code" href="pumax_8c.html#a32a86742844c9c69ff991885e4519233">CreateControlWindow</a>();
  2095. <a name="l02006"></a>02006
  2096. <a name="l02007"></a>02007 OutXSize = (ScreenW-<a class="code" href="pumax_8c.html#a59713e313b4ee9b7937c09d8aeb88994">ScreenOffset</a>) / WinCols;
  2097. <a name="l02008"></a>02008 OutYSize = (CowY-ScreenOffset-1-<a class="code" href="pumax_8c.html#a6e0e87f9eb0c26037ddf9147bf56f097">WM_top_area</a>) / WinRows;
  2098. <a name="l02009"></a>02009 WinXSize = OutXSize - WinLM - <a class="code" href="pumax_8c.html#a261f1b75cb979500af635c616e19771d">WinRM</a>;
  2099. <a name="l02010"></a>02010 WinYSize = OutYSize - WinTM - <a class="code" href="pumax_8c.html#ad6e080222bafe5cdc477c0a8ae13d144">WinBM</a>;
  2100. <a name="l02011"></a>02011 WinSizeHints.flags = PPosition | PSize | PMinSize;
  2101. <a name="l02012"></a>02012 WinSizeHints.min_width = 200;
  2102. <a name="l02013"></a>02013 WinSizeHints.min_height = 100;
  2103. <a name="l02014"></a>02014 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">Debug</a>)
  2104. <a name="l02015"></a>02015 {
  2105. <a name="l02016"></a>02016 printf(<span class="stringliteral">&quot;Outer windowsize = %dx%d\n&quot;</span>,OutXSize,OutYSize);
  2106. <a name="l02017"></a>02017 printf(<span class="stringliteral">&quot;Inner windowsize = %dx%d\n&quot;</span>,WinXSize,WinYSize);
  2107. <a name="l02018"></a>02018 }
  2108. <a name="l02019"></a>02019
  2109. <a name="l02020"></a>02020 wm_hints.initial_state = NormalState;
  2110. <a name="l02021"></a>02021 wm_hints.input = True;
  2111. <a name="l02022"></a>02022 wm_hints.flags = StateHint | InputHint;
  2112. <a name="l02023"></a>02023
  2113. <a name="l02024"></a>02024 class_hints.res_name = progname;
  2114. <a name="l02025"></a>02025 class_hints.res_class = <span class="stringliteral">&quot;PUMA&quot;</span>;
  2115. <a name="l02026"></a>02026
  2116. <a name="l02027"></a>02027 Delwin = XInternAtom(display,<span class="stringliteral">&quot;WM_DELETE_WINDOW&quot;</span>,0);
  2117. <a name="l02028"></a>02028
  2118. <a name="l02029"></a>02029 <a class="code" href="pumax_8c.html#a41e1f6018aa05db3f476b89732b96923">ReadImage</a>(&amp;<a class="code" href="pumax_8c.html#a0aac8b0778521c19e621a6b60b3e1a4b">MapHR</a>,<span class="stringliteral">&quot;map.bmp&quot;</span>);
  2119. <a name="l02030"></a>02030
  2120. <a name="l02031"></a>02031 <span class="keywordflow">for</span> (i = 0 ; i &lt; <a class="code" href="pumax_8c.html#a2364498cd60ebd2201eeef32ce76e882">NumWin</a> ; ++i)
  2121. <a name="l02032"></a>02032 {
  2122. <a name="l02033"></a>02033 x = <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[i].<a class="code" href="struct_win_att_struct.html#aa00d94640c9eb39ceac56f95c595f62a">x</a>;
  2123. <a name="l02034"></a>02034 y = <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[i].<a class="code" href="struct_win_att_struct.html#a770cabf1d350db5890f636ccf30e5d47">y</a>;
  2124. <a name="l02035"></a>02035 w = <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[i].<a class="code" href="struct_win_att_struct.html#a6e7f8041c23d41b7d2835a2b855d35f0">w</a>;
  2125. <a name="l02036"></a>02036 h = <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[i].<a class="code" href="struct_win_att_struct.html#aa9c1c94dee4ebbe95eb392f738835055">h</a>;
  2126. <a name="l02037"></a>02037
  2127. <a name="l02038"></a>02038 <span class="keywordflow">if</span> (x &lt; ScreenOffset || x &gt;= ScreenW) x = ScreenOffset+(i%<a class="code" href="pumax_8c.html#ab861bd4dcef3d655198c4eb74dea5eb7">WinCols</a>)*OutXSize;
  2128. <a name="l02039"></a>02039 <span class="keywordflow">if</span> (y &lt; ScreenOffset || y &gt;= ScreenH) y = ScreenOffset+(i/<a class="code" href="pumax_8c.html#ab861bd4dcef3d655198c4eb74dea5eb7">WinCols</a>)*OutYSize+WM_top_area;
  2129. <a name="l02040"></a>02040 <span class="keywordflow">if</span> (w &lt; WinSizeHints.min_width ) w = <a class="code" href="pumax_8c.html#a90fa18336f52663513916236b6c3f633">WinXSize</a>;
  2130. <a name="l02041"></a>02041 <span class="keywordflow">if</span> (h &lt; WinSizeHints.min_height) h = <a class="code" href="pumax_8c.html#a48ba2c20a7bf82da8f16252eff21155f">WinYSize</a>;
  2131. <a name="l02042"></a>02042 XStringListToTextProperty(&amp;WindowTitle[i],1,WindowName+i);
  2132. <a name="l02043"></a>02043 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[i].active)
  2133. <a name="l02044"></a>02044 {
  2134. <a name="l02045"></a>02045 <span class="keywordflow">if</span> (MRnum == 2 &amp;&amp; MRpid == 1) x += <a class="code" href="pumax_8c.html#a47745e91e472dc647c023d88e004f6be">ScreenW</a>;
  2135. <a name="l02046"></a>02046 Win[i] = XCreateWindow(display,RootWindow(display,screen_num), <span class="comment">// display, parent</span>
  2136. <a name="l02047"></a>02047 x,y,w,h,
  2137. <a name="l02048"></a>02048 BorderWidth,CopyFromParent,InputOutput, <span class="comment">// border, depth, class</span>
  2138. <a name="l02049"></a>02049 CopyFromParent,0,NULL); <span class="comment">// visual, valuemask, attributes</span>
  2139. <a name="l02050"></a>02050 XSetWMProtocols(display,Win[i],&amp;Delwin,1);
  2140. <a name="l02051"></a>02051 XSetWMProperties(display,Win[i],WindowName+i,NULL,
  2141. <a name="l02052"></a>02052 NULL,0,&amp;WinSizeHints,&amp;wm_hints,&amp;class_hints);
  2142. <a name="l02053"></a>02053 XSelectInput(display,Win[i],ButtonPressMask | KeyPressMask | ExposureMask);
  2143. <a name="l02054"></a>02054 XMapWindow(display,Win[i]);
  2144. <a name="l02055"></a>02055 }
  2145. <a name="l02056"></a>02056 }
  2146. <a name="l02057"></a>02057
  2147. <a name="l02058"></a>02058 <span class="comment">/* Prepare GC */</span>
  2148. <a name="l02059"></a>02059
  2149. <a name="l02060"></a>02060 gc = XCreateGC(display, Cow, valuemask, &amp;values);
  2150. <a name="l02061"></a>02061 XSetFont(display, gc, FixFont-&gt;fid);
  2151. <a name="l02062"></a>02062 colormap = XDefaultColormap(display,screen_num);
  2152. <a name="l02063"></a>02063 XSetForeground(display,gc,BlackPix);
  2153. <a name="l02064"></a>02064 XSetBackground(display,gc,WhitePix);
  2154. <a name="l02065"></a>02065
  2155. <a name="l02066"></a>02066 <span class="comment">/* Get keyboard information */</span>
  2156. <a name="l02067"></a>02067
  2157. <a name="l02068"></a>02068 XDisplayKeycodes(display,&amp;FirstKey,&amp;LastKey);
  2158. <a name="l02069"></a>02069 KeyMap = XGetKeyboardMapping(display,FirstKey,LastKey-FirstKey+1,&amp;SymsPerKey);
  2159. <a name="l02070"></a>02070
  2160. <a name="l02071"></a>02071 <span class="comment">/* Allocate color cells */</span>
  2161. <a name="l02072"></a>02072
  2162. <a name="l02073"></a>02073 <span class="keywordflow">for</span> (i=0 ; i &lt; <a class="code" href="pumax_8c.html#afa68e13002f97f4041b7acca426be273">NUMPAL</a> ; ++i)
  2163. <a name="l02074"></a>02074 LineCo[i] = <a class="code" href="pumax_8c.html#a77c9c27e1c3052a37c3cb275828ae40d">AllocateColorCells</a>(Pallet[i]);
  2164. <a name="l02075"></a>02075
  2165. <a name="l02076"></a>02076 <span class="comment">/* Color cells for control window */</span>
  2166. <a name="l02077"></a>02077
  2167. <a name="l02078"></a>02078 XAllocNamedColor(display,colormap,<span class="stringliteral">&quot;red&quot;</span> ,&amp;Red ,&amp;Dummy);
  2168. <a name="l02079"></a>02079 XAllocNamedColor(display,colormap,<span class="stringliteral">&quot;green&quot;</span> ,&amp;Green ,&amp;Dummy);
  2169. <a name="l02080"></a>02080 XAllocNamedColor(display,colormap,<span class="stringliteral">&quot;blue&quot;</span> ,&amp;Blue ,&amp;Dummy);
  2170. <a name="l02081"></a>02081 XAllocNamedColor(display,colormap,<span class="stringliteral">&quot;grey&quot;</span> ,&amp;Grey ,&amp;Dummy);
  2171. <a name="l02082"></a>02082 XAllocNamedColor(display,colormap,<span class="stringliteral">&quot;yellow&quot;</span> ,&amp;Yellow ,&amp;Dummy);
  2172. <a name="l02083"></a>02083 XAllocNamedColor(display,colormap,<span class="stringliteral">&quot;hot pink&quot;</span> ,&amp;LightRed ,&amp;Dummy);
  2173. <a name="l02084"></a>02084 XAllocNamedColor(display,colormap,<span class="stringliteral">&quot;dark red&quot;</span> ,&amp;DarkRed ,&amp;Dummy);
  2174. <a name="l02085"></a>02085 XAllocNamedColor(display,colormap,<span class="stringliteral">&quot;light blue&quot;</span> ,&amp;LightBlue ,&amp;Dummy);
  2175. <a name="l02086"></a>02086 XAllocNamedColor(display,colormap,<span class="stringliteral">&quot;dark blue&quot;</span> ,&amp;DarkBlue ,&amp;Dummy);
  2176. <a name="l02087"></a>02087 XAllocNamedColor(display,colormap,<span class="stringliteral">&quot;light green&quot;</span>,&amp;LightGreen,&amp;Dummy);
  2177. <a name="l02088"></a>02088 XAllocNamedColor(display,colormap,<span class="stringliteral">&quot;dark green&quot;</span> ,&amp;DarkGreen ,&amp;Dummy);
  2178. <a name="l02089"></a>02089
  2179. <a name="l02090"></a>02090 TSColor[0] = Red.pixel;
  2180. <a name="l02091"></a>02091 TSColor[1] = Green.pixel;
  2181. <a name="l02092"></a>02092 TSColor[2] = Blue.pixel;
  2182. <a name="l02093"></a>02093 TSColor[3] = <a class="code" href="pumax_8c.html#a648bfcb426b534ebd09a13bb909de1fe">WhitePix</a>;
  2183. <a name="l02094"></a>02094 TSColor[4] = LightRed.pixel;
  2184. <a name="l02095"></a>02095 TSColor[5] = Grey.pixel;
  2185. <a name="l02096"></a>02096 TSColor[6] = Yellow.pixel;
  2186. <a name="l02097"></a>02097 TSColor[7] = LightBlue.pixel;
  2187. <a name="l02098"></a>02098 TSColor[8] = LightGreen.pixel;
  2188. <a name="l02099"></a>02099
  2189. <a name="l02100"></a>02100 <a class="code" href="pumax_8c.html#af2e92313aaf18974c4fa6c1cb34cd7a3">ClearTracer</a>();
  2190. <a name="l02101"></a>02101 <a class="code" href="pumax_8c.html#ade32a2443eb96bdf5e02320868703e0f">CalcButtonAreas</a>();
  2191. <a name="l02102"></a>02102 <a class="code" href="pumax_8c.html#a41f77efa657ce06e158034152384bf2e">RedrawControlWindow</a>();
  2192. <a name="l02103"></a>02103 XSync(display,0);
  2193. <a name="l02104"></a>02104 }
  2194. <a name="l02105"></a>02105
  2195. <a name="l02106"></a><a class="code" href="pumax_8c.html#a6c5818f7478712a4523abe737e1ce114">02106</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a6c5818f7478712a4523abe737e1ce114">FillPoly</a>(<span class="keywordtype">int</span> n, <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> Poly[])
  2196. <a name="l02107"></a>02107 {
  2197. <a name="l02108"></a>02108 <span class="keywordtype">int</span> i;
  2198. <a name="l02109"></a>02109 XPoint xpol[8];
  2199. <a name="l02110"></a>02110 <span class="keywordflow">for</span> (i=0; i &lt; n ; ++i)
  2200. <a name="l02111"></a>02111 {
  2201. <a name="l02112"></a>02112 xpol[i].x = OffX + Poly[i+i ] + 0.5;
  2202. <a name="l02113"></a>02113 xpol[i].y = OffY + Poly[i+i+1] + 0.5;
  2203. <a name="l02114"></a>02114 }
  2204. <a name="l02115"></a>02115 XFillPolygon(display,pix,gc,xpol,n,Convex,CoordModeOrigin);
  2205. <a name="l02116"></a>02116 }
  2206. <a name="l02117"></a>02117
  2207. <a name="l02118"></a>02118 <span class="comment">/* ======= */</span>
  2208. <a name="l02119"></a>02119 <span class="comment">/* IsoArea */</span>
  2209. <a name="l02120"></a>02120 <span class="comment">/* ======= */</span>
  2210. <a name="l02121"></a>02121
  2211. <a name="l02122"></a><a class="code" href="pumax_8c.html#ad7ade548a65553d0e985249abc1ec296">02122</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#ad7ade548a65553d0e985249abc1ec296">IsoArea</a>(<a class="code" href="pumax_8c.html#afeeffe52c8fd59db7c61cf8b02042dbf">INT</a> y, <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> vl, <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> vh, <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> Top[], <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> Bot[], <a class="code" href="pumax_8c.html#afeeffe52c8fd59db7c61cf8b02042dbf">INT</a> Dim)
  2212. <a name="l02123"></a>02123 {
  2213. <a name="l02124"></a>02124 <a class="code" href="pumax_8c.html#afeeffe52c8fd59db7c61cf8b02042dbf">INT</a> f,x,p;
  2214. <a name="l02125"></a>02125 <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> xl,xr,yt,yb;
  2215. <a name="l02126"></a>02126 <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> Poly[16];
  2216. <a name="l02127"></a>02127
  2217. <a name="l02128"></a>02128 <span class="comment">// if (Debug) printf(&quot;IsoArea %d %10.2f %10.2f %10.2f %10.2f %d\n&quot;,y,vl,vh,Top[0],Bot[0],Dim);</span>
  2218. <a name="l02129"></a>02129 <span class="keywordflow">for</span> (x=0 ; x &lt; Dim-1 ; x++)
  2219. <a name="l02130"></a>02130 {
  2220. <a name="l02131"></a>02131 Flag[x] = 0;
  2221. <a name="l02132"></a>02132 <span class="keywordflow">if</span> (Top[x ] &lt; vl) Flag[x] |= <a class="code" href="pumax_8c.html#a5290d0773637802c437cf688938b1fe9">TOLELO</a>;
  2222. <a name="l02133"></a>02133 <span class="keywordflow">if</span> (Top[x ] &gt;= vh) Flag[x] |= <a class="code" href="pumax_8c.html#a23aceec46faeb7e48b2883afca874b02">TOLEHI</a>;
  2223. <a name="l02134"></a>02134 <span class="keywordflow">if</span> (Top[x+1] &lt; vl) Flag[x] |= <a class="code" href="pumax_8c.html#a89053abaa38cd43b0dbdbf70f6f644bd">TORILO</a>;
  2224. <a name="l02135"></a>02135 <span class="keywordflow">if</span> (Top[x+1] &gt;= vh) Flag[x] |= <a class="code" href="pumax_8c.html#a00b399ecbf8e7ce66fc45ae97d0ef149">TORIHI</a>;
  2225. <a name="l02136"></a>02136 <span class="keywordflow">if</span> (Bot[x ] &lt; vl) Flag[x] |= <a class="code" href="pumax_8c.html#a26b56bf73405ae78f65554674d5bee88">BOLELO</a>;
  2226. <a name="l02137"></a>02137 <span class="keywordflow">if</span> (Bot[x ] &gt;= vh) Flag[x] |= <a class="code" href="pumax_8c.html#aec2de7a30131a34fd4a1475ef8120fc3">BOLEHI</a>;
  2227. <a name="l02138"></a>02138 <span class="keywordflow">if</span> (Bot[x+1] &lt; vl) Flag[x] |= <a class="code" href="pumax_8c.html#ac392454edf5f88606de52c510958b37b">BORILO</a>;
  2228. <a name="l02139"></a>02139 <span class="keywordflow">if</span> (Bot[x+1] &gt;= vh) Flag[x] |= <a class="code" href="pumax_8c.html#ad2487d10128a4605d2c520818e714817">BORIHI</a>;
  2229. <a name="l02140"></a>02140 }
  2230. <a name="l02141"></a>02141
  2231. <a name="l02142"></a>02142 x = 0;
  2232. <a name="l02143"></a>02143
  2233. <a name="l02144"></a>02144 <span class="keywordflow">while</span> (x &lt; Dim-1)
  2234. <a name="l02145"></a>02145 {
  2235. <a name="l02146"></a>02146 xl = VGAX * x ;
  2236. <a name="l02147"></a>02147 xr = VGAX * (x+1);
  2237. <a name="l02148"></a>02148 yt = VGAY * y ;
  2238. <a name="l02149"></a>02149 yb = VGAY * (y+1);
  2239. <a name="l02150"></a>02150 f = Flag[x];
  2240. <a name="l02151"></a>02151
  2241. <a name="l02152"></a>02152 <span class="keywordflow">if</span> (f == 0)
  2242. <a name="l02153"></a>02153 {
  2243. <a name="l02154"></a>02154 x++;
  2244. <a name="l02155"></a>02155 <span class="keywordflow">while</span> (x &lt; Dim-1 &amp;&amp; Flag[x] == 0)
  2245. <a name="l02156"></a>02156 {
  2246. <a name="l02157"></a>02157 x++;
  2247. <a name="l02158"></a>02158 xr = VGAX * x;
  2248. <a name="l02159"></a>02159 }
  2249. <a name="l02160"></a>02160 Poly[0] = Poly[6] = xl;
  2250. <a name="l02161"></a>02161 Poly[1] = Poly[3] = yt;
  2251. <a name="l02162"></a>02162 Poly[2] = Poly[4] = xr;
  2252. <a name="l02163"></a>02163 Poly[5] = Poly[7] = yb;
  2253. <a name="l02164"></a>02164
  2254. <a name="l02165"></a>02165 <a class="code" href="pumax_8c.html#a6c5818f7478712a4523abe737e1ce114">FillPoly</a>(4,Poly);
  2255. <a name="l02166"></a>02166
  2256. <a name="l02167"></a>02167 }
  2257. <a name="l02168"></a>02168 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (f == (<a class="code" href="pumax_8c.html#a5290d0773637802c437cf688938b1fe9">TOLELO</a> | <a class="code" href="pumax_8c.html#a89053abaa38cd43b0dbdbf70f6f644bd">TORILO</a> | <a class="code" href="pumax_8c.html#a26b56bf73405ae78f65554674d5bee88">BOLELO</a> | <a class="code" href="pumax_8c.html#ac392454edf5f88606de52c510958b37b">BORILO</a>) ||
  2258. <a name="l02169"></a>02169 f == (<a class="code" href="pumax_8c.html#a23aceec46faeb7e48b2883afca874b02">TOLEHI</a> | <a class="code" href="pumax_8c.html#a00b399ecbf8e7ce66fc45ae97d0ef149">TORIHI</a> | <a class="code" href="pumax_8c.html#aec2de7a30131a34fd4a1475ef8120fc3">BOLEHI</a> | <a class="code" href="pumax_8c.html#ad2487d10128a4605d2c520818e714817">BORIHI</a>)) x++;
  2259. <a name="l02170"></a>02170 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (Top[x] &lt; vl &amp;&amp; Top[x+1] &gt;= vl &amp;&amp; Bot[x] &gt;= vl &amp;&amp; Bot[x+1] &lt; vl)
  2260. <a name="l02171"></a>02171 {
  2261. <a name="l02172"></a>02172 Poly[1] = Poly[3] = yt;
  2262. <a name="l02173"></a>02173 Poly[2] = Poly[4] = xr;
  2263. <a name="l02174"></a>02174 Poly[0] = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Top[x ],vl,Top[x+1]);
  2264. <a name="l02175"></a>02175 Poly[5] = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x+1],vl,Bot[x+1]);
  2265. <a name="l02176"></a>02176 <a class="code" href="pumax_8c.html#a6c5818f7478712a4523abe737e1ce114">FillPoly</a>(3,Poly);
  2266. <a name="l02177"></a>02177 Poly[1] = Poly[3] = yb;
  2267. <a name="l02178"></a>02178 Poly[2] = Poly[4] = xl;
  2268. <a name="l02179"></a>02179 Poly[0] = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Bot[x ],vl,Bot[x+1]);
  2269. <a name="l02180"></a>02180 Poly[5] = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x ],vl,Bot[x ]);
  2270. <a name="l02181"></a>02181 <a class="code" href="pumax_8c.html#a6c5818f7478712a4523abe737e1ce114">FillPoly</a>(3,Poly);
  2271. <a name="l02182"></a>02182 ++x;
  2272. <a name="l02183"></a>02183 }
  2273. <a name="l02184"></a>02184 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (Top[x] &gt;= vl &amp;&amp; Top[x+1] &lt; vl &amp;&amp; Bot[x] &lt; vl &amp;&amp; Bot[x+1] &gt;= vl)
  2274. <a name="l02185"></a>02185 {
  2275. <a name="l02186"></a>02186 Poly[0] = Poly[4] = xl;
  2276. <a name="l02187"></a>02187 Poly[1] = Poly[3] = yt;
  2277. <a name="l02188"></a>02188 Poly[2] = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Top[x ],vl,Top[x+1]);
  2278. <a name="l02189"></a>02189 Poly[5] = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x ],vl,Bot[x ]);
  2279. <a name="l02190"></a>02190 <a class="code" href="pumax_8c.html#a6c5818f7478712a4523abe737e1ce114">FillPoly</a>(3,Poly);
  2280. <a name="l02191"></a>02191 Poly[0] = Poly[2] = xr;
  2281. <a name="l02192"></a>02192 Poly[3] = Poly[5] = yb;
  2282. <a name="l02193"></a>02193 Poly[1] = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x+1],vl,Bot[x+1]);
  2283. <a name="l02194"></a>02194 Poly[4] = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Bot[x ],vl,Bot[x+1]);
  2284. <a name="l02195"></a>02195 <a class="code" href="pumax_8c.html#a6c5818f7478712a4523abe737e1ce114">FillPoly</a>(3,Poly);
  2285. <a name="l02196"></a>02196 ++x;
  2286. <a name="l02197"></a>02197 }
  2287. <a name="l02198"></a>02198 <span class="keywordflow">else</span>
  2288. <a name="l02199"></a>02199 {
  2289. <a name="l02200"></a>02200 p = 0;
  2290. <a name="l02201"></a>02201
  2291. <a name="l02202"></a>02202 <span class="keywordflow">if</span> (Top[x] &lt; vl)
  2292. <a name="l02203"></a>02203 {
  2293. <a name="l02204"></a>02204 <span class="keywordflow">if</span> (Top[x+1] &gt;= vl)
  2294. <a name="l02205"></a>02205 {
  2295. <a name="l02206"></a>02206 Poly[p++] = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Top[x],vl,Top[x+1]);
  2296. <a name="l02207"></a>02207 Poly[p++] = yt;
  2297. <a name="l02208"></a>02208 }
  2298. <a name="l02209"></a>02209
  2299. <a name="l02210"></a>02210 <span class="keywordflow">if</span> (Top[x+1] &gt;= vh)
  2300. <a name="l02211"></a>02211 {
  2301. <a name="l02212"></a>02212 Poly[p++] = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Top[x],vh,Top[x+1]);
  2302. <a name="l02213"></a>02213 Poly[p++] = yt;
  2303. <a name="l02214"></a>02214 }
  2304. <a name="l02215"></a>02215 }
  2305. <a name="l02216"></a>02216 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (Top[x] &gt;= vh)
  2306. <a name="l02217"></a>02217 {
  2307. <a name="l02218"></a>02218 <span class="keywordflow">if</span> (Top[x+1] &lt; vh)
  2308. <a name="l02219"></a>02219 {
  2309. <a name="l02220"></a>02220 Poly[p++] = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Top[x],vh,Top[x+1]);
  2310. <a name="l02221"></a>02221 Poly[p++] = yt;
  2311. <a name="l02222"></a>02222 }
  2312. <a name="l02223"></a>02223 <span class="keywordflow">if</span> (Top[x+1] &lt; vl)
  2313. <a name="l02224"></a>02224 {
  2314. <a name="l02225"></a>02225 Poly[p++] = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Top[x],vl,Top[x+1]);
  2315. <a name="l02226"></a>02226 Poly[p++] = yt;
  2316. <a name="l02227"></a>02227 }
  2317. <a name="l02228"></a>02228 }
  2318. <a name="l02229"></a>02229 <span class="keywordflow">else</span>
  2319. <a name="l02230"></a>02230 {
  2320. <a name="l02231"></a>02231 Poly[p++] = xl;
  2321. <a name="l02232"></a>02232 Poly[p++] = yt;
  2322. <a name="l02233"></a>02233 <span class="keywordflow">if</span> (Top[x+1] &lt; vl)
  2323. <a name="l02234"></a>02234 {
  2324. <a name="l02235"></a>02235 Poly[p++] = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Top[x],vl,Top[x+1]);
  2325. <a name="l02236"></a>02236 Poly[p++] = yt;
  2326. <a name="l02237"></a>02237 }
  2327. <a name="l02238"></a>02238 <span class="keywordflow">if</span> (Top[x+1] &gt;= vh)
  2328. <a name="l02239"></a>02239 {
  2329. <a name="l02240"></a>02240 Poly[p++] = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Top[x],vh,Top[x+1]);
  2330. <a name="l02241"></a>02241 Poly[p++] = yt;
  2331. <a name="l02242"></a>02242 }
  2332. <a name="l02243"></a>02243 }
  2333. <a name="l02244"></a>02244
  2334. <a name="l02245"></a>02245 <span class="keywordflow">if</span> (Top[x+1] &lt; vl)
  2335. <a name="l02246"></a>02246 {
  2336. <a name="l02247"></a>02247 <span class="keywordflow">if</span> (Bot[x+1] &gt;= vl)
  2337. <a name="l02248"></a>02248 {
  2338. <a name="l02249"></a>02249 Poly[p++] = xr;
  2339. <a name="l02250"></a>02250 Poly[p++] = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x+1],vl,Bot[x+1]);
  2340. <a name="l02251"></a>02251 }
  2341. <a name="l02252"></a>02252
  2342. <a name="l02253"></a>02253 <span class="keywordflow">if</span> (Bot[x+1] &gt;= vh)
  2343. <a name="l02254"></a>02254 {
  2344. <a name="l02255"></a>02255 Poly[p++] = xr;
  2345. <a name="l02256"></a>02256 Poly[p++] = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x+1],vh,Bot[x+1]);
  2346. <a name="l02257"></a>02257 }
  2347. <a name="l02258"></a>02258 }
  2348. <a name="l02259"></a>02259 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (Top[x+1] &gt;= vh)
  2349. <a name="l02260"></a>02260 {
  2350. <a name="l02261"></a>02261 <span class="keywordflow">if</span> (Bot[x+1] &lt; vh)
  2351. <a name="l02262"></a>02262 {
  2352. <a name="l02263"></a>02263 Poly[p++] = xr;
  2353. <a name="l02264"></a>02264 Poly[p++] = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x+1],vh,Bot[x+1]);
  2354. <a name="l02265"></a>02265 }
  2355. <a name="l02266"></a>02266 <span class="keywordflow">if</span> (Bot[x+1] &lt; vl)
  2356. <a name="l02267"></a>02267 {
  2357. <a name="l02268"></a>02268 Poly[p++] = xr;
  2358. <a name="l02269"></a>02269 Poly[p++] = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x+1],vl,Bot[x+1]);
  2359. <a name="l02270"></a>02270 }
  2360. <a name="l02271"></a>02271 }
  2361. <a name="l02272"></a>02272 <span class="keywordflow">else</span>
  2362. <a name="l02273"></a>02273 {
  2363. <a name="l02274"></a>02274 Poly[p++] = xr;
  2364. <a name="l02275"></a>02275 Poly[p++] = yt;
  2365. <a name="l02276"></a>02276 <span class="keywordflow">if</span> (Bot[x+1] &lt; vl)
  2366. <a name="l02277"></a>02277 {
  2367. <a name="l02278"></a>02278 Poly[p++] = xr;
  2368. <a name="l02279"></a>02279 Poly[p++] = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x+1],vl,Bot[x+1]);
  2369. <a name="l02280"></a>02280 }
  2370. <a name="l02281"></a>02281 <span class="keywordflow">if</span> (Bot[x+1] &gt;= vh)
  2371. <a name="l02282"></a>02282 {
  2372. <a name="l02283"></a>02283 Poly[p++] = xr;
  2373. <a name="l02284"></a>02284 Poly[p++] = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x+1],vh,Bot[x+1]);
  2374. <a name="l02285"></a>02285 }
  2375. <a name="l02286"></a>02286 }
  2376. <a name="l02287"></a>02287
  2377. <a name="l02288"></a>02288 <span class="keywordflow">if</span> (Bot[x+1] &lt; vl)
  2378. <a name="l02289"></a>02289 {
  2379. <a name="l02290"></a>02290 <span class="keywordflow">if</span> (Bot[x] &gt;= vl)
  2380. <a name="l02291"></a>02291 {
  2381. <a name="l02292"></a>02292 Poly[p++] = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Bot[x],vl,Bot[x+1]);
  2382. <a name="l02293"></a>02293 Poly[p++] = yb;
  2383. <a name="l02294"></a>02294 }
  2384. <a name="l02295"></a>02295 <span class="keywordflow">if</span> (Bot[x] &gt;= vh)
  2385. <a name="l02296"></a>02296 {
  2386. <a name="l02297"></a>02297 Poly[p++] = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Bot[x],vh,Bot[x+1]);
  2387. <a name="l02298"></a>02298 Poly[p++] = yb;
  2388. <a name="l02299"></a>02299 }
  2389. <a name="l02300"></a>02300 }
  2390. <a name="l02301"></a>02301 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (Bot[x+1] &gt;= vh)
  2391. <a name="l02302"></a>02302 {
  2392. <a name="l02303"></a>02303 <span class="keywordflow">if</span> (Bot[x] &lt; vh)
  2393. <a name="l02304"></a>02304 {
  2394. <a name="l02305"></a>02305 Poly[p++] = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Bot[x],vh,Bot[x+1]);
  2395. <a name="l02306"></a>02306 Poly[p++] = yb;
  2396. <a name="l02307"></a>02307 }
  2397. <a name="l02308"></a>02308 <span class="keywordflow">if</span> (Bot[x] &lt; vl)
  2398. <a name="l02309"></a>02309 {
  2399. <a name="l02310"></a>02310 Poly[p++] = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Bot[x],vl,Bot[x+1]);
  2400. <a name="l02311"></a>02311 Poly[p++] = yb;
  2401. <a name="l02312"></a>02312 }
  2402. <a name="l02313"></a>02313 }
  2403. <a name="l02314"></a>02314 <span class="keywordflow">else</span>
  2404. <a name="l02315"></a>02315 {
  2405. <a name="l02316"></a>02316 Poly[p++] = xr;
  2406. <a name="l02317"></a>02317 Poly[p++] = yb;
  2407. <a name="l02318"></a>02318 <span class="keywordflow">if</span> (Bot[x] &lt; vl)
  2408. <a name="l02319"></a>02319 {
  2409. <a name="l02320"></a>02320 Poly[p++] = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Bot[x],vl,Bot[x+1]);
  2410. <a name="l02321"></a>02321 Poly[p++] = yb;
  2411. <a name="l02322"></a>02322 }
  2412. <a name="l02323"></a>02323 <span class="keywordflow">if</span> (Bot[x] &gt;= vh)
  2413. <a name="l02324"></a>02324 {
  2414. <a name="l02325"></a>02325 Poly[p++] = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Bot[x],vh,Bot[x+1]);
  2415. <a name="l02326"></a>02326 Poly[p++] = yb;
  2416. <a name="l02327"></a>02327 }
  2417. <a name="l02328"></a>02328 }
  2418. <a name="l02329"></a>02329
  2419. <a name="l02330"></a>02330 <span class="keywordflow">if</span> (Bot[x] &lt; vl)
  2420. <a name="l02331"></a>02331 {
  2421. <a name="l02332"></a>02332 <span class="keywordflow">if</span> (Top[x] &gt;= vl)
  2422. <a name="l02333"></a>02333 {
  2423. <a name="l02334"></a>02334 Poly[p++] = xl;
  2424. <a name="l02335"></a>02335 Poly[p++] = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x],vl,Bot[x]);
  2425. <a name="l02336"></a>02336 }
  2426. <a name="l02337"></a>02337
  2427. <a name="l02338"></a>02338 <span class="keywordflow">if</span> (Top[x] &gt;= vh)
  2428. <a name="l02339"></a>02339 {
  2429. <a name="l02340"></a>02340 Poly[p++] = xl;
  2430. <a name="l02341"></a>02341 Poly[p++] = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x],vh,Bot[x]);
  2431. <a name="l02342"></a>02342 }
  2432. <a name="l02343"></a>02343 }
  2433. <a name="l02344"></a>02344 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (Bot[x] &gt;= vh)
  2434. <a name="l02345"></a>02345 {
  2435. <a name="l02346"></a>02346 <span class="keywordflow">if</span> (Top[x] &lt; vh)
  2436. <a name="l02347"></a>02347 {
  2437. <a name="l02348"></a>02348 Poly[p++] = xl;
  2438. <a name="l02349"></a>02349 Poly[p++] = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x],vh,Bot[x]);
  2439. <a name="l02350"></a>02350 }
  2440. <a name="l02351"></a>02351 <span class="keywordflow">if</span> (Top[x] &lt; vl)
  2441. <a name="l02352"></a>02352 {
  2442. <a name="l02353"></a>02353 Poly[p++] = xl;
  2443. <a name="l02354"></a>02354 Poly[p++] = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x],vl,Bot[x]);
  2444. <a name="l02355"></a>02355 }
  2445. <a name="l02356"></a>02356 }
  2446. <a name="l02357"></a>02357 <span class="keywordflow">else</span>
  2447. <a name="l02358"></a>02358 {
  2448. <a name="l02359"></a>02359 Poly[p++] = xl;
  2449. <a name="l02360"></a>02360 Poly[p++] = yb;
  2450. <a name="l02361"></a>02361 <span class="keywordflow">if</span> (Top[x] &lt; vl)
  2451. <a name="l02362"></a>02362 {
  2452. <a name="l02363"></a>02363 Poly[p++] = xl;
  2453. <a name="l02364"></a>02364 Poly[p++] = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x],vl,Bot[x]);
  2454. <a name="l02365"></a>02365 }
  2455. <a name="l02366"></a>02366 <span class="keywordflow">if</span> (Top[x] &gt;= vh)
  2456. <a name="l02367"></a>02367 {
  2457. <a name="l02368"></a>02368 Poly[p++] = xl;
  2458. <a name="l02369"></a>02369 Poly[p++] = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x],vh,Bot[x]);
  2459. <a name="l02370"></a>02370 }
  2460. <a name="l02371"></a>02371 }
  2461. <a name="l02372"></a>02372 <a class="code" href="pumax_8c.html#a6c5818f7478712a4523abe737e1ce114">FillPoly</a>(p&gt;&gt;1,Poly);
  2462. <a name="l02373"></a>02373 x++;
  2463. <a name="l02374"></a>02374 }
  2464. <a name="l02375"></a>02375 }
  2465. <a name="l02376"></a>02376 }
  2466. <a name="l02377"></a>02377
  2467. <a name="l02378"></a>02378
  2468. <a name="l02379"></a>02379 <span class="comment">/* ======= */</span>
  2469. <a name="l02380"></a>02380 <span class="comment">/* isoarea */</span>
  2470. <a name="l02381"></a>02381 <span class="comment">/* ======= */</span>
  2471. <a name="l02382"></a>02382
  2472. <a name="l02383"></a><a class="code" href="pumax_8c.html#a84c2cc0435ae795bd3d15064ffea1501">02383</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a84c2cc0435ae795bd3d15064ffea1501">IsoAreas</a>(<span class="keyword">struct</span> <a class="code" href="struct_color_strip.html">ColorStrip</a> Strip[])
  2473. <a name="l02384"></a>02384 {
  2474. <a name="l02385"></a>02385 <a class="code" href="pumax_8c.html#afeeffe52c8fd59db7c61cf8b02042dbf">INT</a> i;
  2475. <a name="l02386"></a>02386 <a class="code" href="pumax_8c.html#afeeffe52c8fd59db7c61cf8b02042dbf">INT</a> y;
  2476. <a name="l02387"></a>02387 <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> *Top;
  2477. <a name="l02388"></a>02388 <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> *Bot;
  2478. <a name="l02389"></a>02389
  2479. <a name="l02390"></a>02390 i = 0;
  2480. <a name="l02391"></a>02391 <span class="keywordflow">while</span> (Strip[i].Name)
  2481. <a name="l02392"></a>02392 {
  2482. <a name="l02393"></a>02393 Top = <a class="code" href="pumax_8c.html#a253b4cae7d3fe7a244b1bb3163e268f3">Field</a>;
  2483. <a name="l02394"></a>02394 Bot = Field + <a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>;
  2484. <a name="l02395"></a>02395 XSetForeground(display,gc,Strip[i].pixel);
  2485. <a name="l02396"></a>02396 <span class="keywordflow">for</span> (y = 0 ; y &lt; DimY-1 ; y++)
  2486. <a name="l02397"></a>02397 {
  2487. <a name="l02398"></a>02398 <a class="code" href="pumax_8c.html#ad7ade548a65553d0e985249abc1ec296">IsoArea</a>(y,Strip[i].Lo,Strip[i].Hi,Top,Bot,DimX);
  2488. <a name="l02399"></a>02399 Top += <a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>;
  2489. <a name="l02400"></a>02400 Bot += <a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>;
  2490. <a name="l02401"></a>02401 }
  2491. <a name="l02402"></a>02402 ++i;
  2492. <a name="l02403"></a>02403 }
  2493. <a name="l02404"></a>02404 }
  2494. <a name="l02405"></a>02405
  2495. <a name="l02406"></a>02406 <span class="comment">/* ======= */</span>
  2496. <a name="l02407"></a>02407 <span class="comment">/* IsoLine */</span>
  2497. <a name="l02408"></a>02408 <span class="comment">/* ======= */</span>
  2498. <a name="l02409"></a>02409
  2499. <a name="l02410"></a><a class="code" href="pumax_8c.html#a504c78c3761e9eacdf1e513b29f88a5a">02410</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a504c78c3761e9eacdf1e513b29f88a5a">IsoLine</a>(<a class="code" href="pumax_8c.html#afeeffe52c8fd59db7c61cf8b02042dbf">INT</a> y, <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> v, <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> Top[], <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> Bot[], <a class="code" href="pumax_8c.html#afeeffe52c8fd59db7c61cf8b02042dbf">INT</a> Dim)
  2500. <a name="l02411"></a>02411 {
  2501. <a name="l02412"></a>02412 <a class="code" href="pumax_8c.html#afeeffe52c8fd59db7c61cf8b02042dbf">INT</a> f,x;
  2502. <a name="l02413"></a>02413 <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> xl,xr,yt,yb;
  2503. <a name="l02414"></a>02414 <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> x1,yo,x2,y2,x3,y3,x4,y4;
  2504. <a name="l02415"></a>02415
  2505. <a name="l02416"></a>02416 <span class="keywordflow">for</span> (x=0 ; x &lt; Dim-1 ; x++)
  2506. <a name="l02417"></a>02417 {
  2507. <a name="l02418"></a>02418 Flag[x] = 0;
  2508. <a name="l02419"></a>02419 <span class="keywordflow">if</span> (Top[x ] &lt; v) Flag[x] |= <a class="code" href="pumax_8c.html#a5290d0773637802c437cf688938b1fe9">TOLELO</a>;
  2509. <a name="l02420"></a>02420 <span class="keywordflow">else</span> Flag[x] |= <a class="code" href="pumax_8c.html#a23aceec46faeb7e48b2883afca874b02">TOLEHI</a>;
  2510. <a name="l02421"></a>02421 <span class="keywordflow">if</span> (Top[x+1] &lt; v) Flag[x] |= <a class="code" href="pumax_8c.html#a89053abaa38cd43b0dbdbf70f6f644bd">TORILO</a>;
  2511. <a name="l02422"></a>02422 <span class="keywordflow">else</span> Flag[x] |= <a class="code" href="pumax_8c.html#a00b399ecbf8e7ce66fc45ae97d0ef149">TORIHI</a>;
  2512. <a name="l02423"></a>02423 <span class="keywordflow">if</span> (Bot[x ] &lt; v) Flag[x] |= <a class="code" href="pumax_8c.html#a26b56bf73405ae78f65554674d5bee88">BOLELO</a>;
  2513. <a name="l02424"></a>02424 <span class="keywordflow">else</span> Flag[x] |= <a class="code" href="pumax_8c.html#aec2de7a30131a34fd4a1475ef8120fc3">BOLEHI</a>;
  2514. <a name="l02425"></a>02425 <span class="keywordflow">if</span> (Bot[x+1] &lt; v) Flag[x] |= <a class="code" href="pumax_8c.html#ac392454edf5f88606de52c510958b37b">BORILO</a>;
  2515. <a name="l02426"></a>02426 <span class="keywordflow">else</span> Flag[x] |= <a class="code" href="pumax_8c.html#ad2487d10128a4605d2c520818e714817">BORIHI</a>;
  2516. <a name="l02427"></a>02427 }
  2517. <a name="l02428"></a>02428
  2518. <a name="l02429"></a>02429 x = 0;
  2519. <a name="l02430"></a>02430
  2520. <a name="l02431"></a>02431 <span class="keywordflow">while</span> (x &lt; Dim-1)
  2521. <a name="l02432"></a>02432 {
  2522. <a name="l02433"></a>02433 xl = VGAX * x ;
  2523. <a name="l02434"></a>02434 xr = VGAX * (x+1);
  2524. <a name="l02435"></a>02435 yt = VGAY * y ;
  2525. <a name="l02436"></a>02436 yb = VGAY * (y+1);
  2526. <a name="l02437"></a>02437 f = Flag[x];
  2527. <a name="l02438"></a>02438
  2528. <a name="l02439"></a>02439 <span class="keywordflow">if</span> (f == 0 || f == (<a class="code" href="pumax_8c.html#a5290d0773637802c437cf688938b1fe9">TOLELO</a> | <a class="code" href="pumax_8c.html#a89053abaa38cd43b0dbdbf70f6f644bd">TORILO</a> | <a class="code" href="pumax_8c.html#a26b56bf73405ae78f65554674d5bee88">BOLELO</a> | <a class="code" href="pumax_8c.html#ac392454edf5f88606de52c510958b37b">BORILO</a>) ||
  2529. <a name="l02440"></a>02440 f == (<a class="code" href="pumax_8c.html#a23aceec46faeb7e48b2883afca874b02">TOLEHI</a> | <a class="code" href="pumax_8c.html#a00b399ecbf8e7ce66fc45ae97d0ef149">TORIHI</a> | <a class="code" href="pumax_8c.html#aec2de7a30131a34fd4a1475ef8120fc3">BOLEHI</a> | <a class="code" href="pumax_8c.html#ad2487d10128a4605d2c520818e714817">BORIHI</a>)) x++;
  2530. <a name="l02441"></a>02441 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (f == (<a class="code" href="pumax_8c.html#a5290d0773637802c437cf688938b1fe9">TOLELO</a> | <a class="code" href="pumax_8c.html#ac392454edf5f88606de52c510958b37b">BORILO</a> | <a class="code" href="pumax_8c.html#a00b399ecbf8e7ce66fc45ae97d0ef149">TORIHI</a> | <a class="code" href="pumax_8c.html#aec2de7a30131a34fd4a1475ef8120fc3">BOLEHI</a>))
  2531. <a name="l02442"></a>02442 {
  2532. <a name="l02443"></a>02443 x1 = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Top[x ],v,Top[x+1]);
  2533. <a name="l02444"></a>02444 yo = yt;
  2534. <a name="l02445"></a>02445 x2 = xr;
  2535. <a name="l02446"></a>02446 y2 = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x+1],v,Bot[x+1]);
  2536. <a name="l02447"></a>02447 x3 = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Bot[x ],v,Bot[x+1]);
  2537. <a name="l02448"></a>02448 y3 = yb;
  2538. <a name="l02449"></a>02449 x4 = xl;
  2539. <a name="l02450"></a>02450 y4 = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x ],v,Bot[x ]);
  2540. <a name="l02451"></a>02451 XDrawLine(display,pix,gc,x1,OffY+yo,x2,OffY+y2);
  2541. <a name="l02452"></a>02452 XDrawLine(display,pix,gc,x3,OffY+y3,x4,OffY+y4);
  2542. <a name="l02453"></a>02453 ++x;
  2543. <a name="l02454"></a>02454 }
  2544. <a name="l02455"></a>02455 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (f == (<a class="code" href="pumax_8c.html#a89053abaa38cd43b0dbdbf70f6f644bd">TORILO</a> | <a class="code" href="pumax_8c.html#a26b56bf73405ae78f65554674d5bee88">BOLELO</a> | <a class="code" href="pumax_8c.html#a23aceec46faeb7e48b2883afca874b02">TOLEHI</a> | <a class="code" href="pumax_8c.html#ad2487d10128a4605d2c520818e714817">BORIHI</a>))
  2545. <a name="l02456"></a>02456 {
  2546. <a name="l02457"></a>02457 x1 = xl;
  2547. <a name="l02458"></a>02458 yo = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x ],v,Bot[x ]);
  2548. <a name="l02459"></a>02459 x2 = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Top[x ],v,Top[x+1]);
  2549. <a name="l02460"></a>02460 y2 = yt;
  2550. <a name="l02461"></a>02461 x3 = xr;
  2551. <a name="l02462"></a>02462 y3 = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x+1],v,Bot[x+1]);
  2552. <a name="l02463"></a>02463 x4 = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Bot[x ],v,Bot[x+1]);
  2553. <a name="l02464"></a>02464 y4 = yb;
  2554. <a name="l02465"></a>02465 XDrawLine(display,pix,gc,x1,OffY+yo,x2,OffY+y2);
  2555. <a name="l02466"></a>02466 XDrawLine(display,pix,gc,x3,OffY+y3,x4,OffY+y4);
  2556. <a name="l02467"></a>02467 ++x;
  2557. <a name="l02468"></a>02468 }
  2558. <a name="l02469"></a>02469 <span class="keywordflow">else</span>
  2559. <a name="l02470"></a>02470 {
  2560. <a name="l02471"></a>02471 x1 = x2 = x3 = x4 = -1;
  2561. <a name="l02472"></a>02472
  2562. <a name="l02473"></a>02473 <span class="keywordflow">if</span> (Top[x ] &lt; v &amp;&amp; Top[x+1] &gt;= v || Top[x ] &gt;= v &amp;&amp; Top[x+1] &lt; v)
  2563. <a name="l02474"></a>02474 {
  2564. <a name="l02475"></a>02475 x1 = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Top[x ],v,Top[x+1]);
  2565. <a name="l02476"></a>02476 yo = yt;
  2566. <a name="l02477"></a>02477 }
  2567. <a name="l02478"></a>02478 <span class="keywordflow">if</span> (Top[x+1] &lt; v &amp;&amp; Bot[x+1] &gt;= v || Top[x+1] &gt;= v &amp;&amp; Bot[x+1] &lt; v)
  2568. <a name="l02479"></a>02479 {
  2569. <a name="l02480"></a>02480 x2 = xr;
  2570. <a name="l02481"></a>02481 y2 = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x+1],v,Bot[x+1]);
  2571. <a name="l02482"></a>02482 }
  2572. <a name="l02483"></a>02483 <span class="keywordflow">if</span> (Bot[x+1] &lt; v &amp;&amp; Bot[x ] &gt;= v || Bot[x+1] &gt;= v &amp;&amp; Bot[x ] &lt; v)
  2573. <a name="l02484"></a>02484 {
  2574. <a name="l02485"></a>02485 x3 = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Bot[x ],v,Bot[x+1]);
  2575. <a name="l02486"></a>02486 y3 = yb;
  2576. <a name="l02487"></a>02487 }
  2577. <a name="l02488"></a>02488 <span class="keywordflow">if</span> (Bot[x ] &lt; v &amp;&amp; Top[x ] &gt;= v || Bot[x ] &gt;= v &amp;&amp; Top[x ] &lt; v)
  2578. <a name="l02489"></a>02489 {
  2579. <a name="l02490"></a>02490 x4 = xl;
  2580. <a name="l02491"></a>02491 y4 = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x ],v,Bot[x ]);
  2581. <a name="l02492"></a>02492 }
  2582. <a name="l02493"></a>02493
  2583. <a name="l02494"></a>02494 <span class="keywordflow">if</span> (x1 &gt;= 0 &amp;&amp; x2 &gt;= 0 &amp;&amp; x3 &gt;= 0 &amp;&amp; x4 &gt;= 0)
  2584. <a name="l02495"></a>02495 {
  2585. <a name="l02496"></a>02496 XDrawLine(display,pix,gc,x1,OffY+yo,x2,OffY+y2);
  2586. <a name="l02497"></a>02497 XDrawLine(display,pix,gc,x3,OffY+y3,x4,OffY+y4);
  2587. <a name="l02498"></a>02498 }
  2588. <a name="l02499"></a>02499 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (x1 &gt;= 0)
  2589. <a name="l02500"></a>02500 {
  2590. <a name="l02501"></a>02501 <span class="keywordflow">if</span> (x2 &gt;= 0) XDrawLine(display,pix,gc,x1,OffY+yo,x2,OffY+y2);
  2591. <a name="l02502"></a>02502 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (x3 &gt;= 0) XDrawLine(display,pix,gc,x1,OffY+yo,x3,OffY+y3);
  2592. <a name="l02503"></a>02503 <span class="keywordflow">else</span> XDrawLine(display,pix,gc,x1,OffY+yo,x4,OffY+y4);
  2593. <a name="l02504"></a>02504 }
  2594. <a name="l02505"></a>02505 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (x2 &gt;= 0)
  2595. <a name="l02506"></a>02506 {
  2596. <a name="l02507"></a>02507 <span class="keywordflow">if</span> (x3 &gt;= 0) XDrawLine(display,pix,gc,x2,OffY+y2,x3,OffY+y3);
  2597. <a name="l02508"></a>02508 <span class="keywordflow">else</span> XDrawLine(display,pix,gc,x2,OffY+y2,x4,OffY+y4);
  2598. <a name="l02509"></a>02509 }
  2599. <a name="l02510"></a>02510 <span class="keywordflow">else</span> XDrawLine(display,pix,gc,x3,OffY+y3,x4,OffY+y4);
  2600. <a name="l02511"></a>02511
  2601. <a name="l02512"></a>02512 x++;
  2602. <a name="l02513"></a>02513 }
  2603. <a name="l02514"></a>02514 }
  2604. <a name="l02515"></a>02515 }
  2605. <a name="l02516"></a>02516
  2606. <a name="l02517"></a>02517
  2607. <a name="l02518"></a>02518 <span class="comment">/* ======== */</span>
  2608. <a name="l02519"></a>02519 <span class="comment">/* IsoLines */</span>
  2609. <a name="l02520"></a>02520 <span class="comment">/* ======== */</span>
  2610. <a name="l02521"></a>02521
  2611. <a name="l02522"></a><a class="code" href="pumax_8c.html#a7e589e7ff7d5125738a34547b5756253">02522</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a7e589e7ff7d5125738a34547b5756253">IsoLines</a>(<span class="keyword">struct</span> <a class="code" href="struct_color_strip.html">ColorStrip</a> Strip[],<span class="keywordtype">int</span> Colored)
  2612. <a name="l02523"></a>02523 {
  2613. <a name="l02524"></a>02524 <a class="code" href="pumax_8c.html#afeeffe52c8fd59db7c61cf8b02042dbf">INT</a> i;
  2614. <a name="l02525"></a>02525 <a class="code" href="pumax_8c.html#afeeffe52c8fd59db7c61cf8b02042dbf">INT</a> y;
  2615. <a name="l02526"></a>02526 <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> *Top;
  2616. <a name="l02527"></a>02527 <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> *Bot;
  2617. <a name="l02528"></a>02528
  2618. <a name="l02529"></a>02529 XSetForeground(display,gc,BlackPix);
  2619. <a name="l02530"></a>02530 i = 0;
  2620. <a name="l02531"></a>02531 <span class="keywordflow">while</span> (Strip[i].Name)
  2621. <a name="l02532"></a>02532 {
  2622. <a name="l02533"></a>02533 Top = <a class="code" href="pumax_8c.html#a253b4cae7d3fe7a244b1bb3163e268f3">Field</a>;
  2623. <a name="l02534"></a>02534 Bot = Field + <a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>;
  2624. <a name="l02535"></a>02535 <span class="keywordflow">if</span> (Colored) XSetForeground(display,gc,Strip[i].pixel);
  2625. <a name="l02536"></a>02536 <span class="keywordflow">for</span> (y = 0 ; y &lt; DimY-1 ; y++)
  2626. <a name="l02537"></a>02537 {
  2627. <a name="l02538"></a>02538 <a class="code" href="pumax_8c.html#a504c78c3761e9eacdf1e513b29f88a5a">IsoLine</a>(y,Strip[i].Lo,Top,Bot,DimX);
  2628. <a name="l02539"></a>02539 Top += <a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>;
  2629. <a name="l02540"></a>02540 Bot += <a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>;
  2630. <a name="l02541"></a>02541 }
  2631. <a name="l02542"></a>02542 ++i;
  2632. <a name="l02543"></a>02543 }
  2633. <a name="l02544"></a>02544 }
  2634. <a name="l02545"></a>02545
  2635. <a name="l02546"></a><a class="code" href="pumax_8c.html#a9bfabdda2a305f2db1097729ef1c4428">02546</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a9bfabdda2a305f2db1097729ef1c4428">AziPoint</a>(<span class="keywordtype">int</span> fpx, <span class="keywordtype">int</span> fpy, <span class="keywordtype">int</span> *x2, <span class="keywordtype">int</span> *y2)
  2636. <a name="l02547"></a>02547 {
  2637. <a name="l02548"></a>02548 <span class="keywordtype">int</span> xc,yc;
  2638. <a name="l02549"></a>02549 <span class="keywordtype">double</span> flam,fsin,fcos,roa,pil,piy;
  2639. <a name="l02550"></a>02550
  2640. <a name="l02551"></a>02551 xc = InXSize &gt;&gt; 1;
  2641. <a name="l02552"></a>02552 yc = InYSize &gt;&gt; 1;
  2642. <a name="l02553"></a>02553 roa = <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[<a class="code" href="pumax_8c.html#a7fee7b546595edcbee920757b6309386">win</a>].<a class="code" href="struct_map_image_struct.html#a46fe3297a24177fa1aef6e5cf19a4b4b">l</a> * InXSize / 360.0;
  2643. <a name="l02554"></a>02554 pil = 2.0 * M_PI / <a class="code" href="pumax_8c.html#a77751be4ce780fbc796f89264e0834ed">InXSize</a>;
  2644. <a name="l02555"></a>02555 piy = M_PI / <a class="code" href="pumax_8c.html#a2e0311fae05aa716cc8cd6669af5bf3a">InYSize</a>;
  2645. <a name="l02556"></a>02556
  2646. <a name="l02557"></a>02557 flam = (fpx - xc - roa) * pil;
  2647. <a name="l02558"></a>02558 <span class="keywordflow">if</span> (flam &lt; -M_PI) flam += 2.0 * M_PI;
  2648. <a name="l02559"></a>02559 <span class="keywordflow">if</span> (flam &gt; M_PI) flam -= 2.0 * M_PI;
  2649. <a name="l02560"></a>02560 <span class="keywordflow">if</span> (flam &lt; -M_PI_2 || flam &gt; M_PI_2) <span class="keywordflow">return</span> 1;
  2650. <a name="l02561"></a>02561 fsin = sin(flam);
  2651. <a name="l02562"></a>02562 fcos = cos((fpy-yc) * piy);
  2652. <a name="l02563"></a>02563 *x2 = xc + InYSize/2 * fcos * fsin;
  2653. <a name="l02564"></a>02564 *y2 = yc + InYSize/2 * sin((fpy-yc) * piy);
  2654. <a name="l02565"></a>02565 <span class="keywordflow">return</span> 0;
  2655. <a name="l02566"></a>02566 }
  2656. <a name="l02567"></a>02567
  2657. <a name="l02568"></a><a class="code" href="pumax_8c.html#a9b626be7d39ba1ac55ca69aecc44269c">02568</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a9b626be7d39ba1ac55ca69aecc44269c">AziLine</a>(<span class="keywordtype">int</span> x1, <span class="keywordtype">int</span> y1, <span class="keywordtype">int</span> x2, <span class="keywordtype">int</span> y2)
  2658. <a name="l02569"></a>02569 {
  2659. <a name="l02570"></a>02570 <span class="keywordtype">int</span> a1,b1,a2,b2;
  2660. <a name="l02571"></a>02571
  2661. <a name="l02572"></a>02572 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a9bfabdda2a305f2db1097729ef1c4428">AziPoint</a>(x1,y1,&amp;a1,&amp;b1)) <span class="keywordflow">return</span>;
  2662. <a name="l02573"></a>02573 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a9bfabdda2a305f2db1097729ef1c4428">AziPoint</a>(x2,y2,&amp;a2,&amp;b2)) <span class="keywordflow">return</span>;
  2663. <a name="l02574"></a>02574 XDrawLine(display,pix,gc,a1,b1,a2,b2);
  2664. <a name="l02575"></a>02575 }
  2665. <a name="l02576"></a>02576
  2666. <a name="l02577"></a>02577
  2667. <a name="l02578"></a>02578 <span class="comment">/* ======= */</span>
  2668. <a name="l02579"></a>02579 <span class="comment">/* MapLine */</span>
  2669. <a name="l02580"></a>02580 <span class="comment">/* ======= */</span>
  2670. <a name="l02581"></a>02581
  2671. <a name="l02582"></a><a class="code" href="pumax_8c.html#a00887bcdd028fc005fa4e26f5b3c926a">02582</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a00887bcdd028fc005fa4e26f5b3c926a">MapLine</a>(<a class="code" href="pumax_8c.html#afeeffe52c8fd59db7c61cf8b02042dbf">INT</a> y, <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> v, <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> Top[], <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> Bot[], <a class="code" href="pumax_8c.html#afeeffe52c8fd59db7c61cf8b02042dbf">INT</a> Dim)
  2672. <a name="l02583"></a>02583 {
  2673. <a name="l02584"></a>02584 <a class="code" href="pumax_8c.html#afeeffe52c8fd59db7c61cf8b02042dbf">INT</a> f,x;
  2674. <a name="l02585"></a>02585 <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> xl,xr,yt,yb;
  2675. <a name="l02586"></a>02586 <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> x1,yo,x2,y2,x3,y3,x4,y4;
  2676. <a name="l02587"></a>02587
  2677. <a name="l02588"></a>02588 <span class="keywordflow">for</span> (x=0 ; x &lt; Dim-1 ; x++)
  2678. <a name="l02589"></a>02589 {
  2679. <a name="l02590"></a>02590 Flag[x] = 0;
  2680. <a name="l02591"></a>02591 <span class="keywordflow">if</span> (Top[x ] &lt; v) Flag[x] |= <a class="code" href="pumax_8c.html#a5290d0773637802c437cf688938b1fe9">TOLELO</a>;
  2681. <a name="l02592"></a>02592 <span class="keywordflow">else</span> Flag[x] |= <a class="code" href="pumax_8c.html#a23aceec46faeb7e48b2883afca874b02">TOLEHI</a>;
  2682. <a name="l02593"></a>02593 <span class="keywordflow">if</span> (Top[x+1] &lt; v) Flag[x] |= <a class="code" href="pumax_8c.html#a89053abaa38cd43b0dbdbf70f6f644bd">TORILO</a>;
  2683. <a name="l02594"></a>02594 <span class="keywordflow">else</span> Flag[x] |= <a class="code" href="pumax_8c.html#a00b399ecbf8e7ce66fc45ae97d0ef149">TORIHI</a>;
  2684. <a name="l02595"></a>02595 <span class="keywordflow">if</span> (Bot[x ] &lt; v) Flag[x] |= <a class="code" href="pumax_8c.html#a26b56bf73405ae78f65554674d5bee88">BOLELO</a>;
  2685. <a name="l02596"></a>02596 <span class="keywordflow">else</span> Flag[x] |= <a class="code" href="pumax_8c.html#aec2de7a30131a34fd4a1475ef8120fc3">BOLEHI</a>;
  2686. <a name="l02597"></a>02597 <span class="keywordflow">if</span> (Bot[x+1] &lt; v) Flag[x] |= <a class="code" href="pumax_8c.html#ac392454edf5f88606de52c510958b37b">BORILO</a>;
  2687. <a name="l02598"></a>02598 <span class="keywordflow">else</span> Flag[x] |= <a class="code" href="pumax_8c.html#ad2487d10128a4605d2c520818e714817">BORIHI</a>;
  2688. <a name="l02599"></a>02599 }
  2689. <a name="l02600"></a>02600
  2690. <a name="l02601"></a>02601 x = 0;
  2691. <a name="l02602"></a>02602
  2692. <a name="l02603"></a>02603 <span class="keywordflow">while</span> (x &lt; Dim-1)
  2693. <a name="l02604"></a>02604 {
  2694. <a name="l02605"></a>02605 xl = VGAX * x ;
  2695. <a name="l02606"></a>02606 xr = VGAX * (x+1);
  2696. <a name="l02607"></a>02607 yt = VGAY * y ;
  2697. <a name="l02608"></a>02608 yb = VGAY * (y+1);
  2698. <a name="l02609"></a>02609 f = Flag[x];
  2699. <a name="l02610"></a>02610
  2700. <a name="l02611"></a>02611 <span class="keywordflow">if</span> (f == 0 || f == (<a class="code" href="pumax_8c.html#a5290d0773637802c437cf688938b1fe9">TOLELO</a> | <a class="code" href="pumax_8c.html#a89053abaa38cd43b0dbdbf70f6f644bd">TORILO</a> | <a class="code" href="pumax_8c.html#a26b56bf73405ae78f65554674d5bee88">BOLELO</a> | <a class="code" href="pumax_8c.html#ac392454edf5f88606de52c510958b37b">BORILO</a>) ||
  2701. <a name="l02612"></a>02612 f == (<a class="code" href="pumax_8c.html#a23aceec46faeb7e48b2883afca874b02">TOLEHI</a> | <a class="code" href="pumax_8c.html#a00b399ecbf8e7ce66fc45ae97d0ef149">TORIHI</a> | <a class="code" href="pumax_8c.html#aec2de7a30131a34fd4a1475ef8120fc3">BOLEHI</a> | <a class="code" href="pumax_8c.html#ad2487d10128a4605d2c520818e714817">BORIHI</a>)) x++;
  2702. <a name="l02613"></a>02613 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (f == (<a class="code" href="pumax_8c.html#a5290d0773637802c437cf688938b1fe9">TOLELO</a> | <a class="code" href="pumax_8c.html#ac392454edf5f88606de52c510958b37b">BORILO</a> | <a class="code" href="pumax_8c.html#a00b399ecbf8e7ce66fc45ae97d0ef149">TORIHI</a> | <a class="code" href="pumax_8c.html#aec2de7a30131a34fd4a1475ef8120fc3">BOLEHI</a>))
  2703. <a name="l02614"></a>02614 {
  2704. <a name="l02615"></a>02615 x1 = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Top[x ],v,Top[x+1]);
  2705. <a name="l02616"></a>02616 yo = yt;
  2706. <a name="l02617"></a>02617 x2 = xr;
  2707. <a name="l02618"></a>02618 y2 = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x+1],v,Bot[x+1]);
  2708. <a name="l02619"></a>02619 x3 = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Bot[x ],v,Bot[x+1]);
  2709. <a name="l02620"></a>02620 y3 = yb;
  2710. <a name="l02621"></a>02621 x4 = xl;
  2711. <a name="l02622"></a>02622 y4 = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x ],v,Bot[x ]);
  2712. <a name="l02623"></a>02623 <a class="code" href="pumax_8c.html#a9b626be7d39ba1ac55ca69aecc44269c">AziLine</a>(x1,OffY+yo,x2,OffY+y2);
  2713. <a name="l02624"></a>02624 <a class="code" href="pumax_8c.html#a9b626be7d39ba1ac55ca69aecc44269c">AziLine</a>(x3,OffY+y3,x4,OffY+y4);
  2714. <a name="l02625"></a>02625 ++x;
  2715. <a name="l02626"></a>02626 }
  2716. <a name="l02627"></a>02627 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (f == (<a class="code" href="pumax_8c.html#a89053abaa38cd43b0dbdbf70f6f644bd">TORILO</a> | <a class="code" href="pumax_8c.html#a26b56bf73405ae78f65554674d5bee88">BOLELO</a> | <a class="code" href="pumax_8c.html#a23aceec46faeb7e48b2883afca874b02">TOLEHI</a> | <a class="code" href="pumax_8c.html#ad2487d10128a4605d2c520818e714817">BORIHI</a>))
  2717. <a name="l02628"></a>02628 {
  2718. <a name="l02629"></a>02629 x1 = xl;
  2719. <a name="l02630"></a>02630 yo = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x ],v,Bot[x ]);
  2720. <a name="l02631"></a>02631 x2 = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Top[x ],v,Top[x+1]);
  2721. <a name="l02632"></a>02632 y2 = yt;
  2722. <a name="l02633"></a>02633 x3 = xr;
  2723. <a name="l02634"></a>02634 y3 = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x+1],v,Bot[x+1]);
  2724. <a name="l02635"></a>02635 x4 = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Bot[x ],v,Bot[x+1]);
  2725. <a name="l02636"></a>02636 y4 = yb;
  2726. <a name="l02637"></a>02637 <a class="code" href="pumax_8c.html#a9b626be7d39ba1ac55ca69aecc44269c">AziLine</a>(x1,OffY+yo,x2,OffY+y2);
  2727. <a name="l02638"></a>02638 <a class="code" href="pumax_8c.html#a9b626be7d39ba1ac55ca69aecc44269c">AziLine</a>(x3,OffY+y3,x4,OffY+y4);
  2728. <a name="l02639"></a>02639 ++x;
  2729. <a name="l02640"></a>02640 }
  2730. <a name="l02641"></a>02641 <span class="keywordflow">else</span>
  2731. <a name="l02642"></a>02642 {
  2732. <a name="l02643"></a>02643 x1 = x2 = x3 = x4 = -1;
  2733. <a name="l02644"></a>02644
  2734. <a name="l02645"></a>02645 <span class="keywordflow">if</span> (Top[x ] &lt; v &amp;&amp; Top[x+1] &gt;= v || Top[x ] &gt;= v &amp;&amp; Top[x+1] &lt; v)
  2735. <a name="l02646"></a>02646 {
  2736. <a name="l02647"></a>02647 x1 = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Top[x ],v,Top[x+1]);
  2737. <a name="l02648"></a>02648 yo = yt;
  2738. <a name="l02649"></a>02649 }
  2739. <a name="l02650"></a>02650 <span class="keywordflow">if</span> (Top[x+1] &lt; v &amp;&amp; Bot[x+1] &gt;= v || Top[x+1] &gt;= v &amp;&amp; Bot[x+1] &lt; v)
  2740. <a name="l02651"></a>02651 {
  2741. <a name="l02652"></a>02652 x2 = xr;
  2742. <a name="l02653"></a>02653 y2 = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x+1],v,Bot[x+1]);
  2743. <a name="l02654"></a>02654 }
  2744. <a name="l02655"></a>02655 <span class="keywordflow">if</span> (Bot[x+1] &lt; v &amp;&amp; Bot[x ] &gt;= v || Bot[x+1] &gt;= v &amp;&amp; Bot[x ] &lt; v)
  2745. <a name="l02656"></a>02656 {
  2746. <a name="l02657"></a>02657 x3 = <a class="code" href="pumax_8c.html#a206ade3db8b254271ebb6f283b7d56e9">IPX</a>(Bot[x ],v,Bot[x+1]);
  2747. <a name="l02658"></a>02658 y3 = yb;
  2748. <a name="l02659"></a>02659 }
  2749. <a name="l02660"></a>02660 <span class="keywordflow">if</span> (Bot[x ] &lt; v &amp;&amp; Top[x ] &gt;= v || Bot[x ] &gt;= v &amp;&amp; Top[x ] &lt; v)
  2750. <a name="l02661"></a>02661 {
  2751. <a name="l02662"></a>02662 x4 = xl;
  2752. <a name="l02663"></a>02663 y4 = <a class="code" href="pumax_8c.html#a723a06f7d61f6cfca3e2dd361e3c8b84">IPY</a>(Top[x ],v,Bot[x ]);
  2753. <a name="l02664"></a>02664 }
  2754. <a name="l02665"></a>02665
  2755. <a name="l02666"></a>02666 <span class="keywordflow">if</span> (x1 &gt;= 0 &amp;&amp; x2 &gt;= 0 &amp;&amp; x3 &gt;= 0 &amp;&amp; x4 &gt;= 0)
  2756. <a name="l02667"></a>02667 {
  2757. <a name="l02668"></a>02668 <a class="code" href="pumax_8c.html#a9b626be7d39ba1ac55ca69aecc44269c">AziLine</a>(x1,OffY+yo,x2,OffY+y2);
  2758. <a name="l02669"></a>02669 <a class="code" href="pumax_8c.html#a9b626be7d39ba1ac55ca69aecc44269c">AziLine</a>(x3,OffY+y3,x4,OffY+y4);
  2759. <a name="l02670"></a>02670 }
  2760. <a name="l02671"></a>02671 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (x1 &gt;= 0)
  2761. <a name="l02672"></a>02672 {
  2762. <a name="l02673"></a>02673 <span class="keywordflow">if</span> (x2 &gt;= 0) <a class="code" href="pumax_8c.html#a9b626be7d39ba1ac55ca69aecc44269c">AziLine</a>(x1,OffY+yo,x2,OffY+y2);
  2763. <a name="l02674"></a>02674 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (x3 &gt;= 0) <a class="code" href="pumax_8c.html#a9b626be7d39ba1ac55ca69aecc44269c">AziLine</a>(x1,OffY+yo,x3,OffY+y3);
  2764. <a name="l02675"></a>02675 <span class="keywordflow">else</span> <a class="code" href="pumax_8c.html#a9b626be7d39ba1ac55ca69aecc44269c">AziLine</a>(x1,OffY+yo,x4,OffY+y4);
  2765. <a name="l02676"></a>02676 }
  2766. <a name="l02677"></a>02677 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (x2 &gt;= 0)
  2767. <a name="l02678"></a>02678 {
  2768. <a name="l02679"></a>02679 <span class="keywordflow">if</span> (x3 &gt;= 0) <a class="code" href="pumax_8c.html#a9b626be7d39ba1ac55ca69aecc44269c">AziLine</a>(x2,OffY+y2,x3,OffY+y3);
  2769. <a name="l02680"></a>02680 <span class="keywordflow">else</span> <a class="code" href="pumax_8c.html#a9b626be7d39ba1ac55ca69aecc44269c">AziLine</a>(x2,OffY+y2,x4,OffY+y4);
  2770. <a name="l02681"></a>02681 }
  2771. <a name="l02682"></a>02682 <span class="keywordflow">else</span> <a class="code" href="pumax_8c.html#a9b626be7d39ba1ac55ca69aecc44269c">AziLine</a>(x3,OffY+y3,x4,OffY+y4);
  2772. <a name="l02683"></a>02683
  2773. <a name="l02684"></a>02684 x++;
  2774. <a name="l02685"></a>02685 }
  2775. <a name="l02686"></a>02686 }
  2776. <a name="l02687"></a>02687 }
  2777. <a name="l02688"></a>02688
  2778. <a name="l02689"></a>02689
  2779. <a name="l02690"></a>02690 <span class="comment">/* ======== */</span>
  2780. <a name="l02691"></a>02691 <span class="comment">/* MapLines */</span>
  2781. <a name="l02692"></a>02692 <span class="comment">/* ======== */</span>
  2782. <a name="l02693"></a>02693
  2783. <a name="l02694"></a><a class="code" href="pumax_8c.html#aa0f5f3d7c6ce01b3b6fda010e082dd77">02694</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#aa0f5f3d7c6ce01b3b6fda010e082dd77">MapLines</a>(<span class="keyword">struct</span> <a class="code" href="struct_color_strip.html">ColorStrip</a> Strip[],<span class="keywordtype">int</span> Colored)
  2784. <a name="l02695"></a>02695 {
  2785. <a name="l02696"></a>02696 <a class="code" href="pumax_8c.html#afeeffe52c8fd59db7c61cf8b02042dbf">INT</a> i;
  2786. <a name="l02697"></a>02697 <a class="code" href="pumax_8c.html#afeeffe52c8fd59db7c61cf8b02042dbf">INT</a> y;
  2787. <a name="l02698"></a>02698 <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> *Top;
  2788. <a name="l02699"></a>02699 <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> *Bot;
  2789. <a name="l02700"></a>02700
  2790. <a name="l02701"></a>02701 XSetForeground(display,gc,BlackPix);
  2791. <a name="l02702"></a>02702 i = 0;
  2792. <a name="l02703"></a>02703 <span class="keywordflow">while</span> (Strip[i].Name)
  2793. <a name="l02704"></a>02704 {
  2794. <a name="l02705"></a>02705 Top = <a class="code" href="pumax_8c.html#a253b4cae7d3fe7a244b1bb3163e268f3">Field</a>;
  2795. <a name="l02706"></a>02706 Bot = Field + <a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>;
  2796. <a name="l02707"></a>02707 <span class="keywordflow">if</span> (Colored) XSetForeground(display,gc,Strip[i].pixel);
  2797. <a name="l02708"></a>02708 <span class="keywordflow">for</span> (y = 0 ; y &lt; DimY-1 ; y++)
  2798. <a name="l02709"></a>02709 {
  2799. <a name="l02710"></a>02710 <a class="code" href="pumax_8c.html#a00887bcdd028fc005fa4e26f5b3c926a">MapLine</a>(y,Strip[i].Lo,Top,Bot,DimX);
  2800. <a name="l02711"></a>02711 Top += <a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>;
  2801. <a name="l02712"></a>02712 Bot += <a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>;
  2802. <a name="l02713"></a>02713 }
  2803. <a name="l02714"></a>02714 ++i;
  2804. <a name="l02715"></a>02715 }
  2805. <a name="l02716"></a>02716 }
  2806. <a name="l02717"></a>02717
  2807. <a name="l02718"></a><a class="code" href="pumax_8c.html#a73d7fb41b6b6b8934862332333623d8c">02718</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a73d7fb41b6b6b8934862332333623d8c">polco</a> = 0;
  2808. <a name="l02719"></a>02719
  2809. <a name="l02720"></a><a class="code" href="pumax_8c.html#af256ffce2b6bb644016fe5500c154447">02720</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#af256ffce2b6bb644016fe5500c154447">poltra</a>(<span class="keywordtype">float</span> lam, <span class="keywordtype">float</span> phi, <span class="keywordtype">float</span> *x, <span class="keywordtype">float</span> *y)
  2810. <a name="l02721"></a>02721 {
  2811. <a name="l02722"></a>02722 <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> xnp,ynp,xsp,ysp,lfa;
  2812. <a name="l02723"></a>02723
  2813. <a name="l02724"></a>02724 lfa = (2.0 * M_PI) / (InXSize-1) ;
  2814. <a name="l02725"></a>02725 xnp = (InXSize-1) * 0.25;
  2815. <a name="l02726"></a>02726 ynp = (InYSize-1) * 0.50;
  2816. <a name="l02727"></a>02727 xsp = (InXSize-1) * 0.75;
  2817. <a name="l02728"></a>02728 ysp = ynp;
  2818. <a name="l02729"></a>02729
  2819. <a name="l02730"></a>02730 <span class="comment">/* Northern hemisphere */</span>
  2820. <a name="l02731"></a>02731
  2821. <a name="l02732"></a>02732 <span class="keywordflow">if</span> (phi &lt; ynp)
  2822. <a name="l02733"></a>02733 {
  2823. <a name="l02734"></a>02734 *x = xnp + sin(lam * lfa) * phi;
  2824. <a name="l02735"></a>02735 *y = ynp + cos(lam * lfa) * phi;
  2825. <a name="l02736"></a>02736 }
  2826. <a name="l02737"></a>02737
  2827. <a name="l02738"></a>02738 <span class="comment">/* Souhern hemisphere */</span>
  2828. <a name="l02739"></a>02739
  2829. <a name="l02740"></a>02740 <span class="keywordflow">else</span>
  2830. <a name="l02741"></a>02741 {
  2831. <a name="l02742"></a>02742 *x = xsp - sin(lam * lfa) * (phi-ysp);
  2832. <a name="l02743"></a>02743 *y = ysp + cos(lam * lfa) * (phi-ysp);
  2833. <a name="l02744"></a>02744 }
  2834. <a name="l02745"></a>02745 }
  2835. <a name="l02746"></a>02746
  2836. <a name="l02747"></a>02747
  2837. <a name="l02748"></a>02748 <span class="comment">/* ========== */</span>
  2838. <a name="l02749"></a>02749 <span class="comment">/* TracerPlot */</span>
  2839. <a name="l02750"></a>02750 <span class="comment">/* ========== */</span>
  2840. <a name="l02751"></a>02751
  2841. <a name="l02752"></a><a class="code" href="pumax_8c.html#ab15932b28ace63693c23be5e639ed1d9">02752</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#ab15932b28ace63693c23be5e639ed1d9">TracerPlot</a>(<span class="keywordtype">int</span> w)
  2842. <a name="l02753"></a>02753 {
  2843. <a name="l02754"></a>02754 <span class="keywordtype">int</span> j,ipx,ipy,lpy,lpx,jx,jy,ic,ix,iy,ipr;
  2844. <a name="l02755"></a>02755 <span class="keywordtype">int</span> xnp,ynp,xsp,ysp,xc,yc;
  2845. <a name="l02756"></a>02756 <span class="keywordtype">float</span> *u;
  2846. <a name="l02757"></a>02757 <span class="keywordtype">float</span> *v;
  2847. <a name="l02758"></a>02758 <span class="keywordtype">float</span> fpx,fpy,du,dv,ppx,ppy,rx,ry,spfac;
  2848. <a name="l02759"></a>02759 <span class="keywordtype">float</span> lfa,lam,phi,hpy,fcos,fsin;
  2849. <a name="l02760"></a>02760 <span class="keywordtype">float</span> pil,piy;
  2850. <a name="l02761"></a>02761 <span class="keywordtype">float</span> roa;
  2851. <a name="l02762"></a>02762 <span class="keywordtype">float</span> flam;
  2852. <a name="l02763"></a>02763 <span class="keywordtype">float</span> dpx,dpy;
  2853. <a name="l02764"></a>02764
  2854. <a name="l02765"></a>02765 <span class="keywordflow">if</span> (Uindex &lt; 0 || Vindex &lt; 0) <span class="keywordflow">return</span>; <span class="comment">// Data missing</span>
  2855. <a name="l02766"></a>02766
  2856. <a name="l02767"></a>02767 Delpar = (8 * 60) / DeltaTime; <span class="comment">// Injection interval</span>
  2857. <a name="l02768"></a>02768 <span class="keywordflow">if</span> (LevelChanged[w]) <a class="code" href="pumax_8c.html#af2e92313aaf18974c4fa6c1cb34cd7a3">ClearTracer</a>();
  2858. <a name="l02769"></a>02769 LevelChanged[w] = 0;
  2859. <a name="l02770"></a>02770 <span class="keywordflow">if</span> (!SpeedScale) SpeedScale = <a class="code" href="pumax_8c.html#a2ec2314ef785dc1cddc562590cd034ad">FloatAlloc</a>(DimY,<span class="stringliteral">&quot;SpeedScale&quot;</span>);
  2860. <a name="l02771"></a>02771 u = <a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[<a class="code" href="pumax_8c.html#abec6f96b33294d2bb005f4aa387ee123">Uindex</a>].<a class="code" href="struct_array_struct.html#a38c55a484b3d01e2ffa11f14de2adfd9">Data</a> + Indez[w] * <a class="code" href="pumax_8c.html#a132288db6a5e56bd89aedf01da72b83f">DimXY</a>;
  2861. <a name="l02772"></a>02772 v = <a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[<a class="code" href="pumax_8c.html#abb16042facad6e19f6bdada929a4522a">Vindex</a>].<a class="code" href="struct_array_struct.html#a38c55a484b3d01e2ffa11f14de2adfd9">Data</a> + Indez[w] * <a class="code" href="pumax_8c.html#a132288db6a5e56bd89aedf01da72b83f">DimXY</a>;
  2862. <a name="l02773"></a>02773
  2863. <a name="l02774"></a>02774 TracerColor = Yellow.pixel;
  2864. <a name="l02775"></a>02775 <span class="keywordflow">if</span> (nstep % (8*Delpar) == 0) ColInd++;
  2865. <a name="l02776"></a>02776 <span class="keywordflow">if</span> (ColInd &gt;= <a class="code" href="pumax_8c.html#a7f2aa7d59c57b8054e230e2f72564671">AUTOCOLORS</a>) ColInd = 0;
  2866. <a name="l02777"></a>02777 TracerColor = Autostrip[<a class="code" href="pumax_8c.html#ad3a3fa1de4fcbf5d06e0ac6277cb85a3">ColInd</a>].<a class="code" href="struct_color_strip.html#ab1a6137a580d2a1817f4d8e127d4743c">pixel</a>;
  2867. <a name="l02778"></a>02778
  2868. <a name="l02779"></a>02779 dpx = (float)(InXSize-1) / (float)(DimX-1);
  2869. <a name="l02780"></a>02780 dpy = (float)(InYSize-1) / (float)(DimY-1);
  2870. <a name="l02781"></a>02781 lpx = <a class="code" href="pumax_8c.html#a77751be4ce780fbc796f89264e0834ed">InXSize</a>;
  2871. <a name="l02782"></a>02782 lpy = <a class="code" href="pumax_8c.html#a2e0311fae05aa716cc8cd6669af5bf3a">InYSize</a>;
  2872. <a name="l02783"></a>02783 hpy = 0.5 * dpy;
  2873. <a name="l02784"></a>02784 xc = lpx / 2;
  2874. <a name="l02785"></a>02785 yc = lpy / 2;
  2875. <a name="l02786"></a>02786 ipr = InXSize / 400;
  2876. <a name="l02787"></a>02787 pil = 2.0 * M_PI / lpx;
  2877. <a name="l02788"></a>02788 piy = M_PI / lpy;
  2878. <a name="l02789"></a>02789 roa = <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].<a class="code" href="struct_map_image_struct.html#a46fe3297a24177fa1aef6e5cf19a4b4b">l</a> * lpx / 360.0;
  2879. <a name="l02790"></a>02790
  2880. <a name="l02791"></a>02791 <span class="comment">// Compute scale factors</span>
  2881. <a name="l02792"></a>02792
  2882. <a name="l02793"></a>02793 <span class="keywordflow">if</span> (SizeChanged || nstep &lt; 10)
  2883. <a name="l02794"></a>02794 {
  2884. <a name="l02795"></a>02795 <span class="keywordflow">for</span> (j=0 ; j &lt; <a class="code" href="pumax_8c.html#ace2f02cb6559cc7f528a995935d30878">DimY</a>; ++j)
  2885. <a name="l02796"></a>02796 {
  2886. <a name="l02797"></a>02797 SpeedScale[j] = InXSize * DeltaTime * 60.0 / 40000000.0
  2887. <a name="l02798"></a>02798 / cos((j-0.5*(DimY-1)) * (M_PI/DimY));
  2888. <a name="l02799"></a>02799 }
  2889. <a name="l02800"></a>02800 SpeedScale[DimY-1] = SpeedScale[0] = SpeedScale[1];
  2890. <a name="l02801"></a>02801 }
  2891. <a name="l02802"></a>02802
  2892. <a name="l02803"></a>02803 <span class="comment">// Insert new particles</span>
  2893. <a name="l02804"></a>02804
  2894. <a name="l02805"></a>02805 <span class="keywordflow">if</span> (nstep % Delpar == 0)
  2895. <a name="l02806"></a>02806 {
  2896. <a name="l02807"></a>02807 fpx = dpx * (DimX-1) / 2.0;
  2897. <a name="l02808"></a>02808 <span class="keywordflow">for</span> (ipy = 0 ; ipy &lt; lpy ; ipy += dpy)
  2898. <a name="l02809"></a>02809 {
  2899. <a name="l02810"></a>02810 ParInd = (ParInd+1) &amp; (<a class="code" href="pumax_8c.html#ab5a0dcea45727946af71ece4d11e0278">MAXPAR</a>-1);
  2900. <a name="l02811"></a>02811 pax[<a class="code" href="pumax_8c.html#ad9c64621bb1d0a098f803d806afe7549">ParInd</a>] = fpx;
  2901. <a name="l02812"></a>02812 pay[<a class="code" href="pumax_8c.html#ad9c64621bb1d0a098f803d806afe7549">ParInd</a>] = ipy + hpy;
  2902. <a name="l02813"></a>02813 pal[<a class="code" href="pumax_8c.html#ad9c64621bb1d0a098f803d806afe7549">ParInd</a>] = <a class="code" href="pumax_8c.html#a593e4a6696ba37b5108d683e031afc64">TracerColor</a>;
  2903. <a name="l02814"></a>02814 }
  2904. <a name="l02815"></a>02815 }
  2905. <a name="l02816"></a>02816
  2906. <a name="l02817"></a>02817 <span class="comment">// Move particles</span>
  2907. <a name="l02818"></a>02818
  2908. <a name="l02819"></a>02819 <span class="keywordflow">for</span> (j=0 ; j &lt; <a class="code" href="pumax_8c.html#ab5a0dcea45727946af71ece4d11e0278">MAXPAR</a> ; ++j)
  2909. <a name="l02820"></a>02820 <span class="keywordflow">if</span> (pax[j] &gt;= 0.0 &amp;&amp; pay[j] &gt;= 0.0)
  2910. <a name="l02821"></a>02821 {
  2911. <a name="l02822"></a>02822 jx = rx = pax[j] / dpx;
  2912. <a name="l02823"></a>02823 jy = ry = pay[j] / dpy;
  2913. <a name="l02824"></a>02824 ic = jx + DimX * jy;
  2914. <a name="l02825"></a>02825 ix = ic + 1;
  2915. <a name="l02826"></a>02826 <span class="keywordflow">if</span> (jx &gt;= DimX-1) ix -= <a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>;
  2916. <a name="l02827"></a>02827 iy = ic + <a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>;
  2917. <a name="l02828"></a>02828 <span class="keywordflow">if</span> (iy &gt;= DimX * DimY) iy -= <a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>;
  2918. <a name="l02829"></a>02829 rx -= jx;
  2919. <a name="l02830"></a>02830 ry -= jy;
  2920. <a name="l02831"></a>02831
  2921. <a name="l02832"></a>02832 du = u[ic]+(u[ix]-u[ic])*rx+(u[iy]-u[ic])*ry;
  2922. <a name="l02833"></a>02833 dv = v[ic]+(v[ix]-v[ic])*rx+(v[iy]-v[ic])*ry;
  2923. <a name="l02834"></a>02834 spfac = SpeedScale[jy] + (SpeedScale[jy+1]-SpeedScale[jy]) * ry;
  2924. <a name="l02835"></a>02835 du *= spfac;
  2925. <a name="l02836"></a>02836 dv *= spfac;
  2926. <a name="l02837"></a>02837 fpx = pax[j] + du;
  2927. <a name="l02838"></a>02838 fpy = pay[j] + dv;
  2928. <a name="l02839"></a>02839 <span class="keywordflow">if</span> (fpx &lt; 0.0) fpx += lpx;
  2929. <a name="l02840"></a>02840 <span class="keywordflow">if</span> (fpx &gt;= lpx) fpx -= lpx;
  2930. <a name="l02841"></a>02841 <span class="keywordflow">if</span> (fpy &lt; 0.0 || fpy &gt; lpy-1)
  2931. <a name="l02842"></a>02842 {
  2932. <a name="l02843"></a>02843 pay[j] = -1.0;
  2933. <a name="l02844"></a>02844 <span class="keywordflow">continue</span>;
  2934. <a name="l02845"></a>02845 }
  2935. <a name="l02846"></a>02846 pax[j] = fpx;
  2936. <a name="l02847"></a>02847 pay[j] = fpy;
  2937. <a name="l02848"></a>02848 ipx = -1;
  2938. <a name="l02849"></a>02849 <span class="keywordflow">if</span> (MapPro[w] == <a class="code" href="pumax_8c.html#ad431eb8cf00095009fcd1924efffa213">POLAR</a>)
  2939. <a name="l02850"></a>02850 {
  2940. <a name="l02851"></a>02851 lfa = (2.0 * M_PI) / lpx;
  2941. <a name="l02852"></a>02852 xnp = (InXSize-1) * 0.25;
  2942. <a name="l02853"></a>02853 ynp = (InYSize-1) * 0.50;
  2943. <a name="l02854"></a>02854 xsp = (InXSize-1) * 0.75;
  2944. <a name="l02855"></a>02855 ysp = ynp;
  2945. <a name="l02856"></a>02856 lam = fpx;
  2946. <a name="l02857"></a>02857 phi = fpy;
  2947. <a name="l02858"></a>02858 <span class="keywordflow">if</span> (phi &lt; 0.5 * lpy) <span class="comment">/* Northern hemisphere */</span>
  2948. <a name="l02859"></a>02859 {
  2949. <a name="l02860"></a>02860 fpx = xnp - sin(lam * lfa) * (phi + hpy);
  2950. <a name="l02861"></a>02861 fpy = ynp - cos(lam * lfa) * (phi + hpy);
  2951. <a name="l02862"></a>02862 }
  2952. <a name="l02863"></a>02863 <span class="keywordflow">else</span> <span class="comment">/* Souhern hemisphere */</span>
  2953. <a name="l02864"></a>02864 {
  2954. <a name="l02865"></a>02865 fpx = xsp + sin(lam * lfa) * (lpy - phi + hpy);
  2955. <a name="l02866"></a>02866 fpy = ysp - cos(lam * lfa) * (lpy - phi + hpy);
  2956. <a name="l02867"></a>02867 }
  2957. <a name="l02868"></a>02868 ipx = rintf(fpx);
  2958. <a name="l02869"></a>02869 ipy = rintf(fpy);
  2959. <a name="l02870"></a>02870 }
  2960. <a name="l02871"></a>02871 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (MapPro[w] == <a class="code" href="pumax_8c.html#aae4090be0e30c18b0f22650479767d8f">AZIMUTHAL</a>)
  2961. <a name="l02872"></a>02872 {
  2962. <a name="l02873"></a>02873 flam = (fpx - xc - roa) * pil;
  2963. <a name="l02874"></a>02874 <span class="keywordflow">if</span> (flam &lt; -M_PI) flam += 2.0 * M_PI;
  2964. <a name="l02875"></a>02875 <span class="keywordflow">if</span> (flam &gt; M_PI) flam -= 2.0 * M_PI;
  2965. <a name="l02876"></a>02876 <span class="keywordflow">if</span> (flam &lt; -M_PI_2 || flam &gt; M_PI_2) <span class="keywordflow">continue</span>;
  2966. <a name="l02877"></a>02877 fsin = sin(flam);
  2967. <a name="l02878"></a>02878 fcos = cos((fpy-yc) * piy);
  2968. <a name="l02879"></a>02879 fpx = xc + lpy/2 * fcos * fsin;
  2969. <a name="l02880"></a>02880 fpy = yc + lpy/2 * sin((fpy-yc) * piy);
  2970. <a name="l02881"></a>02881 ipx = rintf(fpx);
  2971. <a name="l02882"></a>02882 ipy = rintf(fpy);
  2972. <a name="l02883"></a>02883 }
  2973. <a name="l02884"></a>02884 <span class="keywordflow">else</span>
  2974. <a name="l02885"></a>02885 {
  2975. <a name="l02886"></a>02886 ipx = rintf(fpx);
  2976. <a name="l02887"></a>02887 ipy = rintf(fpy);
  2977. <a name="l02888"></a>02888 }
  2978. <a name="l02889"></a>02889 <span class="keywordflow">if</span> (ipx &gt;= 0)
  2979. <a name="l02890"></a>02890 {
  2980. <a name="l02891"></a>02891 XSetForeground(display,gc,pal[j]);
  2981. <a name="l02892"></a>02892 <span class="keywordflow">if</span> (ipr &lt; 2) XDrawPoint(display,pix,gc,ipx,ipy);
  2982. <a name="l02893"></a>02893 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ipr == 2) XFillRectangle(display,pix,gc,ipx,ipy,2,2);
  2983. <a name="l02894"></a>02894 <span class="keywordflow">else</span> XFillArc(display,pix,gc,ipx,ipy,ipr,ipr,0,360*64);
  2984. <a name="l02895"></a>02895 }
  2985. <a name="l02896"></a>02896 }
  2986. <a name="l02897"></a>02897 }
  2987. <a name="l02898"></a>02898
  2988. <a name="l02899"></a>02899
  2989. <a name="l02900"></a>02900 <span class="comment">/* ============= */</span>
  2990. <a name="l02901"></a>02901 <span class="comment">/* AmplitudePlot */</span>
  2991. <a name="l02902"></a>02902 <span class="comment">/* ============= */</span>
  2992. <a name="l02903"></a>02903
  2993. <a name="l02904"></a><a class="code" href="pumax_8c.html#aed8ad522611a864b8abd8b245d68ceac">02904</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#aed8ad522611a864b8abd8b245d68ceac">AmplitudePlot</a>(<span class="keywordtype">void</span>)
  2994. <a name="l02905"></a>02905 {
  2995. <a name="l02906"></a>02906 <span class="keywordtype">int</span> i,j,m,n;
  2996. <a name="l02907"></a>02907 <span class="keywordtype">int</span> x,y;
  2997. <a name="l02908"></a>02908 <span class="keywordtype">int</span> r,dx,dy;
  2998. <a name="l02909"></a>02909 <span class="keywordtype">int</span> mmax;
  2999. <a name="l02910"></a>02910 <span class="keywordtype">int</span> imax;
  3000. <a name="l02911"></a>02911 <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> Amax,Fac;
  3001. <a name="l02912"></a>02912
  3002. <a name="l02913"></a>02913 <span class="keywordflow">if</span> (!Ampli) Ampli = <a class="code" href="pumax_8c.html#a2ec2314ef785dc1cddc562590cd034ad">FloatAlloc</a>(DimX,<span class="stringliteral">&quot;Ampli&quot;</span>);
  3003. <a name="l02914"></a>02914 <span class="keywordflow">if</span> (!Acol ) Acol = <a class="code" href="pumax_8c.html#aa507b1280c95bd8fb1d42c60d91e02ff">SizeAlloc</a>(DimX,<span class="keyword">sizeof</span>(XColor),<span class="stringliteral">&quot;Acol&quot;</span>);
  3004. <a name="l02915"></a>02915
  3005. <a name="l02916"></a>02916 Amax = 0.0;
  3006. <a name="l02917"></a>02917 imax = 0;
  3007. <a name="l02918"></a>02918 <span class="keywordflow">for</span> (i=0 ; i &lt; <a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a> ; ++i)
  3008. <a name="l02919"></a>02919 {
  3009. <a name="l02920"></a>02920 Ampli[i] = log (1.0 + sqrt(Field[2*i]*Field[2*i]+Field[2*i+1]*Field[2*i+1]));
  3010. <a name="l02921"></a>02921 Acol[i].pixel = <a class="code" href="pumax_8c.html#a648bfcb426b534ebd09a13bb909de1fe">WhitePix</a>;
  3011. <a name="l02922"></a>02922 <span class="keywordflow">if</span> (Ampli[i] &gt; Amax &amp;&amp; i &gt; DimY)
  3012. <a name="l02923"></a>02923 {
  3013. <a name="l02924"></a>02924 Amax = Ampli[i];
  3014. <a name="l02925"></a>02925 imax = i;
  3015. <a name="l02926"></a>02926 }
  3016. <a name="l02927"></a>02927 }
  3017. <a name="l02928"></a>02928
  3018. <a name="l02929"></a>02929 Fac = 0.0;
  3019. <a name="l02930"></a>02930 <span class="keywordflow">if</span> (Amax &gt; 1.e-20) Fac = 1.0 / Amax;
  3020. <a name="l02931"></a>02931 <span class="keywordflow">for</span> (i=0 ; i &lt; <a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a> ; ++i)
  3021. <a name="l02932"></a>02932 {
  3022. <a name="l02933"></a>02933 j = <a class="code" href="pumax_8c.html#a9923377bd967d1dd49eb98f009f48fc2">AMPLI_COLS</a> * Ampli[i] * Fac;
  3023. <a name="l02934"></a>02934 <span class="keywordflow">if</span> (j &gt;= <a class="code" href="pumax_8c.html#a9923377bd967d1dd49eb98f009f48fc2">AMPLI_COLS</a>) j = <a class="code" href="pumax_8c.html#a9923377bd967d1dd49eb98f009f48fc2">AMPLI_COLS</a>-1;
  3024. <a name="l02935"></a>02935 Acol[i].pixel = AmpliStrip[j].<a class="code" href="struct_color_strip.html#ab1a6137a580d2a1817f4d8e127d4743c">pixel</a>;
  3025. <a name="l02936"></a>02936 }
  3026. <a name="l02937"></a>02937
  3027. <a name="l02938"></a>02938 dx = WinXSize / 23;
  3028. <a name="l02939"></a>02939 r = (dx+dx) / 3;
  3029. <a name="l02940"></a>02940 mmax = (InYSize / dx) - 1;
  3030. <a name="l02941"></a>02941 XSetForeground(display,gc,BlackPix);
  3031. <a name="l02942"></a>02942 <span class="keywordflow">for</span> (m=0,i=0 ; m &lt; mmax ; ++m)
  3032. <a name="l02943"></a>02943 {
  3033. <a name="l02944"></a>02944 y = FixFontHeight + 4 + m * dx;
  3034. <a name="l02945"></a>02945 <span class="keywordflow">for</span> (n=m ; n &lt; <a class="code" href="pumax_8c.html#ace2f02cb6559cc7f528a995935d30878">DimY</a> ; ++n,++i)
  3035. <a name="l02946"></a>02946 <span class="keywordflow">if</span> (n &lt; 22)
  3036. <a name="l02947"></a>02947 {
  3037. <a name="l02948"></a>02948 x = dx/2 + n * dx;
  3038. <a name="l02949"></a>02949 XSetForeground(display,gc,Acol[i].pixel);
  3039. <a name="l02950"></a>02950 XFillArc(display,pix,gc,x,y,r,r,0,360*64);
  3040. <a name="l02951"></a>02951 }
  3041. <a name="l02952"></a>02952 }
  3042. <a name="l02953"></a>02953 }
  3043. <a name="l02954"></a>02954
  3044. <a name="l02955"></a>02955
  3045. <a name="l02956"></a><a class="code" href="pumax_8c.html#a2f9a1f5b15d5b0b8305a40270b38ab97">02956</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a2f9a1f5b15d5b0b8305a40270b38ab97">RedrawIsoWindow</a>(<span class="keywordtype">int</span> w)
  3046. <a name="l02957"></a>02957 {
  3047. <a name="l02958"></a>02958 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a66932718d5aaaf8cd382d6e8e681b96a">WinPixMap</a>[w].Pix)
  3048. <a name="l02959"></a>02959 XCopyArea(display,<a class="code" href="pumax_8c.html#a66932718d5aaaf8cd382d6e8e681b96a">WinPixMap</a>[w].Pix,Win[w],gc,0,0,<a class="code" href="pumax_8c.html#a66932718d5aaaf8cd382d6e8e681b96a">WinPixMap</a>[w].DimX,<a class="code" href="pumax_8c.html#a66932718d5aaaf8cd382d6e8e681b96a">WinPixMap</a>[w].DimY,0,0);
  3049. <a name="l02960"></a>02960 }
  3050. <a name="l02961"></a>02961
  3051. <a name="l02962"></a>02962
  3052. <a name="l02963"></a><a class="code" href="pumax_8c.html#a64f109d6e1965c07709ba668a8e0e349">02963</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a64f109d6e1965c07709ba668a8e0e349">CloseWindow</a>(<span class="keywordtype">int</span> i)
  3053. <a name="l02964"></a>02964 {
  3054. <a name="l02965"></a>02965 <a class="code" href="pumax_8c.html#a83e35c70462fc81d9b622790c8661e8e">INTXS</a> X,Y,xp,yp;
  3055. <a name="l02966"></a>02966 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> border,depth;
  3056. <a name="l02967"></a>02967 Window Rootwin,Child;
  3057. <a name="l02968"></a>02968
  3058. <a name="l02969"></a>02969 <span class="keywordflow">if</span> (Win[i])
  3059. <a name="l02970"></a>02970 {
  3060. <a name="l02971"></a>02971 XGetGeometry(display,Win[i],&amp;Rootwin,&amp;xp,&amp;yp,&amp;<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[i].w,&amp;<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[i].h,&amp;border,&amp;depth);
  3061. <a name="l02972"></a>02972 XTranslateCoordinates(display,Win[i],Rootwin,0,0,&amp;X,&amp;Y,&amp;Child);
  3062. <a name="l02973"></a>02973 <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[i].<a class="code" href="struct_win_att_struct.html#aa00d94640c9eb39ceac56f95c595f62a">x</a> = X - <a class="code" href="pumax_8c.html#a0a8a8622ae71c04112e4e0d9ccda7817">WinLM</a>;
  3063. <a name="l02974"></a>02974 <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[i].<a class="code" href="struct_win_att_struct.html#a770cabf1d350db5890f636ccf30e5d47">y</a> = Y - <a class="code" href="pumax_8c.html#a6529bd28fe04607bb7d71ff00a101e52">WinTM</a>;
  3064. <a name="l02975"></a>02975 XDestroyWindow(display,Win[i]);
  3065. <a name="l02976"></a>02976 Win[i] = 0;
  3066. <a name="l02977"></a>02977 <a class="code" href="pumax_8c.html#a49d7de013de4c527a1bc7d1db4ea07d2">ShowWindowStatus</a>();
  3067. <a name="l02978"></a>02978 }
  3068. <a name="l02979"></a>02979 }
  3069. <a name="l02980"></a>02980
  3070. <a name="l02981"></a><a class="code" href="pumax_8c.html#a3a74ca8916dc6e6193c5f4ef8abec8ea">02981</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a3a74ca8916dc6e6193c5f4ef8abec8ea">ReopenWindow</a>(<span class="keywordtype">int</span> i)
  3071. <a name="l02982"></a>02982 {
  3072. <a name="l02983"></a>02983 <span class="keywordflow">if</span> (Win[i] == 0)
  3073. <a name="l02984"></a>02984 {
  3074. <a name="l02985"></a>02985 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[i].x &lt; ScreenOffset) <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[i].<a class="code" href="struct_win_att_struct.html#aa00d94640c9eb39ceac56f95c595f62a">x</a> = ScreenOffset + OutXSize * (i % <a class="code" href="pumax_8c.html#ab861bd4dcef3d655198c4eb74dea5eb7">WinCols</a>);
  3075. <a name="l02986"></a>02986 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[i].y &lt; ScreenOffset) <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[i].<a class="code" href="struct_win_att_struct.html#a770cabf1d350db5890f636ccf30e5d47">y</a> = ScreenOffset + OutYSize * (i / <a class="code" href="pumax_8c.html#ab861bd4dcef3d655198c4eb74dea5eb7">WinCols</a>);
  3076. <a name="l02987"></a>02987 Win[i] = XCreateSimpleWindow(display,RootWindow(display,screen_num),
  3077. <a name="l02988"></a>02988 <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[i].x,<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[i].y,<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[i].w,<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[i].h,
  3078. <a name="l02989"></a>02989 BorderWidth,BlackPix,WhitePix);
  3079. <a name="l02990"></a>02990 XSetWMProtocols(display,Win[i],&amp;Delwin,1);
  3080. <a name="l02991"></a>02991 XSetWMProperties(display,Win[i],WindowName+i,NULL,
  3081. <a name="l02992"></a>02992 NULL,0,&amp;WinSizeHints,&amp;wm_hints,&amp;class_hints);
  3082. <a name="l02993"></a>02993 XSelectInput(display,Win[i],ButtonPressMask | KeyPressMask | ExposureMask);
  3083. <a name="l02994"></a>02994 XMapWindow(display,Win[i]);
  3084. <a name="l02995"></a>02995 <a class="code" href="pumax_8c.html#a49d7de013de4c527a1bc7d1db4ea07d2">ShowWindowStatus</a>();
  3085. <a name="l02996"></a>02996 }
  3086. <a name="l02997"></a>02997 }
  3087. <a name="l02998"></a>02998
  3088. <a name="l02999"></a><a class="code" href="pumax_8c.html#ad66f6229486420387d334e2685e85808">02999</a> <span class="keywordtype">char</span> *<a class="code" href="pumax_8c.html#ad66f6229486420387d334e2685e85808">HelpText</a>[] =
  3089. <a name="l03000"></a>03000 {
  3090. <a name="l03001"></a>03001 <span class="stringliteral">&quot;Key assignment for azimuthal projection &quot;</span>,
  3091. <a name="l03002"></a>03002 <span class="stringliteral">&quot;--------------------------------------------&quot;</span>,
  3092. <a name="l03003"></a>03003 <span class="stringliteral">&quot;&lt;- cursor left : increase westward rotation&quot;</span>,
  3093. <a name="l03004"></a>03004 <span class="stringliteral">&quot;-&gt; cursor right : increase eastward rotation&quot;</span>,
  3094. <a name="l03005"></a>03005 <span class="stringliteral">&quot;============================================&quot;</span>,
  3095. <a name="l03006"></a>03006 <span class="stringliteral">&quot;Key assignment for 3D variables &quot;</span>,
  3096. <a name="l03007"></a>03007 <span class="stringliteral">&quot;--------------------------------------------&quot;</span>,
  3097. <a name="l03008"></a>03008 <span class="stringliteral">&quot;^ cursor up : display next upper level &quot;</span>,
  3098. <a name="l03009"></a>03009 <span class="stringliteral">&quot;v cursor down : display next lower level &quot;</span>,
  3099. <a name="l03010"></a>03010 <span class="stringliteral">&quot;============================================&quot;</span>,
  3100. <a name="l03011"></a>03011 <span class="stringliteral">&quot;Key assignment for Lon/Lev or Hovmoeller &quot;</span>,
  3101. <a name="l03012"></a>03012 <span class="stringliteral">&quot;--------------------------------------------&quot;</span>,
  3102. <a name="l03013"></a>03013 <span class="stringliteral">&quot;^ cursor up : switch latitude northwards&quot;</span>,
  3103. <a name="l03014"></a>03014 <span class="stringliteral">&quot;v cursor down : switch latitude southwards&quot;</span>,
  3104. <a name="l03015"></a>03015 <span class="stringliteral">&quot;============================================&quot;</span>,
  3105. <a name="l03016"></a>03016 <span class="stringliteral">&quot;Mouse button assignment &quot;</span>,
  3106. <a name="l03017"></a>03017 <span class="stringliteral">&quot;--------------------------------------------&quot;</span>,
  3107. <a name="l03018"></a>03018 <span class="stringliteral">&quot;Left button : decrease level or latitude&quot;</span>,
  3108. <a name="l03019"></a>03019 <span class="stringliteral">&quot;Right button : increase level or latitude&quot;</span>,
  3109. <a name="l03020"></a>03020 <span class="stringliteral">&quot;Middle button : cycle through projections &quot;</span>
  3110. <a name="l03021"></a>03021 };
  3111. <a name="l03022"></a>03022
  3112. <a name="l03023"></a><a class="code" href="pumax_8c.html#adf9aace229442ed28b0437507d712a38">03023</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#adf9aace229442ed28b0437507d712a38">HelpLines</a> = <span class="keyword">sizeof</span>(<a class="code" href="pumax_8c.html#ad66f6229486420387d334e2685e85808">HelpText</a>) / <span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *);
  3113. <a name="l03024"></a>03024
  3114. <a name="l03025"></a><a class="code" href="pumax_8c.html#aba750e7646eb34565d33fea6f31b676b">03025</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#aba750e7646eb34565d33fea6f31b676b">DrawHelpWindow</a>(<span class="keywordtype">void</span>)
  3115. <a name="l03026"></a>03026 {
  3116. <a name="l03027"></a>03027 <span class="keywordtype">int</span> x,y,j,l;
  3117. <a name="l03028"></a>03028
  3118. <a name="l03029"></a>03029 XSetForeground(display,gc,Yellow.pixel);
  3119. <a name="l03030"></a>03030 XSetBackground(display,gc,DarkBlue.pixel);
  3120. <a name="l03031"></a>03031 XSetFont(display,gc,BigFont-&gt;fid);
  3121. <a name="l03032"></a>03032
  3122. <a name="l03033"></a>03033 x = BigFontWidth / 2;
  3123. <a name="l03034"></a>03034 <span class="keywordflow">for</span> (j=0 ; j &lt; <a class="code" href="pumax_8c.html#adf9aace229442ed28b0437507d712a38">HelpLines</a> ; ++j)
  3124. <a name="l03035"></a>03035 {
  3125. <a name="l03036"></a>03036 y = BigFontHeight / 2 + BigFont-&gt;ascent + j * <a class="code" href="pumax_8c.html#a1d2254b4c4eccb72efc38d231910fe68">BigFontHeight</a>;
  3126. <a name="l03037"></a>03037 l = strlen(HelpText[j]);
  3127. <a name="l03038"></a>03038 XDrawImageString(display,HelpWindow,gc,x,y,HelpText[j],l);
  3128. <a name="l03039"></a>03039 }
  3129. <a name="l03040"></a>03040 }
  3130. <a name="l03041"></a>03041
  3131. <a name="l03042"></a><a class="code" href="pumax_8c.html#a8a5aec9b47f5687c664df38d92daccf2">03042</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a8a5aec9b47f5687c664df38d92daccf2">DisplayHelpWindow</a>(<span class="keywordtype">void</span>)
  3132. <a name="l03043"></a>03043 {
  3133. <a name="l03044"></a>03044 <span class="keywordtype">int</span> x,y,w,h;
  3134. <a name="l03045"></a>03045 <span class="keywordtype">char</span> *HelpTitle = <span class="stringliteral">&quot;Help&quot;</span>;
  3135. <a name="l03046"></a>03046
  3136. <a name="l03047"></a>03047 w = BigFontWidth * (strlen(HelpText[0])+1);
  3137. <a name="l03048"></a>03048 h = BigFontHeight * (HelpLines + 1);
  3138. <a name="l03049"></a>03049 x = (ScreenW - w) / 2;
  3139. <a name="l03050"></a>03050 y = (ScreenH - h) / 2;
  3140. <a name="l03051"></a>03051 HelpWindow = XCreateSimpleWindow(display,RootWindow(display,screen_num),
  3141. <a name="l03052"></a>03052 x,y,w,h,BorderWidth,Yellow.pixel,DarkBlue.pixel);
  3142. <a name="l03053"></a>03053 XStringListToTextProperty(&amp;HelpTitle,1,&amp;HelpName);
  3143. <a name="l03054"></a>03054 XSetWMProtocols(display,HelpWindow,&amp;Delwin,1);
  3144. <a name="l03055"></a>03055 XSetWMProperties(display,HelpWindow,&amp;HelpName,NULL,NULL,0,NULL,NULL,NULL);
  3145. <a name="l03056"></a>03056 XSelectInput(display,HelpWindow,ButtonPressMask | ExposureMask);
  3146. <a name="l03057"></a>03057 XMapWindow(display,HelpWindow);
  3147. <a name="l03058"></a>03058 XMoveWindow(display,HelpWindow,x,y);
  3148. <a name="l03059"></a>03059 <a class="code" href="pumax_8c.html#aba750e7646eb34565d33fea6f31b676b">DrawHelpWindow</a>();
  3149. <a name="l03060"></a>03060 }
  3150. <a name="l03061"></a>03061
  3151. <a name="l03062"></a><a class="code" href="pumax_8c.html#a535c697445b712fe16a24d9050968306">03062</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a535c697445b712fe16a24d9050968306">HitGridButton</a>(XEvent* xe)
  3152. <a name="l03063"></a>03063 {
  3153. <a name="l03064"></a>03064 <span class="keywordflow">return</span> (
  3154. <a name="l03065"></a>03065 (xe-&gt;xbutton.button == Button1) &amp;&amp;
  3155. <a name="l03066"></a>03066 (xe-&gt;xbutton.x &gt;= Grid_XL ) &amp;&amp;
  3156. <a name="l03067"></a>03067 (xe-&gt;xbutton.x &lt;= Grid_XH ) &amp;&amp;
  3157. <a name="l03068"></a>03068 (xe-&gt;xbutton.y &gt;= Grid_YL ) &amp;&amp;
  3158. <a name="l03069"></a>03069 (xe-&gt;xbutton.y &lt;= Grid_YH ));
  3159. <a name="l03070"></a>03070 }
  3160. <a name="l03071"></a>03071
  3161. <a name="l03072"></a><a class="code" href="pumax_8c.html#a2068accf6bb5b7d5b33dd6289b1f5f02">03072</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a2068accf6bb5b7d5b33dd6289b1f5f02">HitPauseButton</a>(XEvent* xe)
  3162. <a name="l03073"></a>03073 {
  3163. <a name="l03074"></a>03074 <span class="keywordflow">return</span> (
  3164. <a name="l03075"></a>03075 (xe-&gt;xbutton.button == Button1) &amp;&amp;
  3165. <a name="l03076"></a>03076 (xe-&gt;xbutton.x &gt;= Pause_XL-2 ) &amp;&amp;
  3166. <a name="l03077"></a>03077 (xe-&gt;xbutton.x &lt;= Pause_XH+2 ) &amp;&amp;
  3167. <a name="l03078"></a>03078 (xe-&gt;xbutton.y &gt;= Pause_YL-2 ) &amp;&amp;
  3168. <a name="l03079"></a>03079 (xe-&gt;xbutton.y &lt;= Pause_YH+2 ));
  3169. <a name="l03080"></a>03080 }
  3170. <a name="l03081"></a>03081
  3171. <a name="l03082"></a><a class="code" href="pumax_8c.html#a9d02ed3207b28b02c7cc0ea8c3f51339">03082</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a9d02ed3207b28b02c7cc0ea8c3f51339">HitStartButton</a>(XEvent* xe)
  3172. <a name="l03083"></a>03083 {
  3173. <a name="l03084"></a>03084 <span class="keywordflow">return</span> (
  3174. <a name="l03085"></a>03085 (xe-&gt;xbutton.button == Button1) &amp;&amp;
  3175. <a name="l03086"></a>03086 (xe-&gt;xbutton.x &gt;= Start_XL-2 ) &amp;&amp;
  3176. <a name="l03087"></a>03087 (xe-&gt;xbutton.x &lt;= Start_XH+2 ) &amp;&amp;
  3177. <a name="l03088"></a>03088 (xe-&gt;xbutton.y &gt;= Start_YL-2 ) &amp;&amp;
  3178. <a name="l03089"></a>03089 (xe-&gt;xbutton.y &lt;= Start_YH+2 ));
  3179. <a name="l03090"></a>03090 }
  3180. <a name="l03091"></a>03091
  3181. <a name="l03092"></a><a class="code" href="pumax_8c.html#a4ee12e86b4f071483510dac61cf7a92a">03092</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a4ee12e86b4f071483510dac61cf7a92a">HitStopButton</a>(XEvent* xe)
  3182. <a name="l03093"></a>03093 {
  3183. <a name="l03094"></a>03094 <span class="keywordflow">return</span> (
  3184. <a name="l03095"></a>03095 (xe-&gt;xbutton.button == Button1) &amp;&amp;
  3185. <a name="l03096"></a>03096 (xe-&gt;xbutton.x &gt;= Stop_XL-2 ) &amp;&amp;
  3186. <a name="l03097"></a>03097 (xe-&gt;xbutton.x &lt;= Stop_XH+2 ) &amp;&amp;
  3187. <a name="l03098"></a>03098 (xe-&gt;xbutton.y &gt;= Stop_YL-2 ) &amp;&amp;
  3188. <a name="l03099"></a>03099 (xe-&gt;xbutton.y &lt;= Stop_YH+2 ));
  3189. <a name="l03100"></a>03100 }
  3190. <a name="l03101"></a>03101
  3191. <a name="l03102"></a><a class="code" href="pumax_8c.html#a15071e2ea43672ffd1cefb9c61903c75">03102</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a15071e2ea43672ffd1cefb9c61903c75">HitHelpButton</a>(XEvent* xe)
  3192. <a name="l03103"></a>03103 {
  3193. <a name="l03104"></a>03104 <span class="keywordflow">return</span> (
  3194. <a name="l03105"></a>03105 (xe-&gt;xbutton.button == Button1) &amp;&amp;
  3195. <a name="l03106"></a>03106 (xe-&gt;xbutton.x &gt;= Help_XL-2 ) &amp;&amp;
  3196. <a name="l03107"></a>03107 (xe-&gt;xbutton.x &lt;= Help_XH+2 ) &amp;&amp;
  3197. <a name="l03108"></a>03108 (xe-&gt;xbutton.y &gt;= Help_YL-2 ) &amp;&amp;
  3198. <a name="l03109"></a>03109 (xe-&gt;xbutton.y &lt;= Help_YH+2 ));
  3199. <a name="l03110"></a>03110 }
  3200. <a name="l03111"></a>03111
  3201. <a name="l03112"></a><a class="code" href="pumax_8c.html#a426fec9e632373d9e59e1a060447b47d">03112</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a426fec9e632373d9e59e1a060447b47d">HitPlusButton</a>(XEvent* xe)
  3202. <a name="l03113"></a>03113 {
  3203. <a name="l03114"></a>03114 <span class="keywordflow">return</span> (
  3204. <a name="l03115"></a>03115 (xe-&gt;xbutton.button == Button1) &amp;&amp;
  3205. <a name="l03116"></a>03116 (xe-&gt;xbutton.x &gt;= Plus_XL ) &amp;&amp;
  3206. <a name="l03117"></a>03117 (xe-&gt;xbutton.x &lt;= Plus_XH ) &amp;&amp;
  3207. <a name="l03118"></a>03118 (xe-&gt;xbutton.y &gt;= Plus_YL ) &amp;&amp;
  3208. <a name="l03119"></a>03119 (xe-&gt;xbutton.y &lt;= Plus_YH ));
  3209. <a name="l03120"></a>03120 }
  3210. <a name="l03121"></a>03121
  3211. <a name="l03122"></a><a class="code" href="pumax_8c.html#aa59ba543293311702ee814a61ca43df0">03122</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#aa59ba543293311702ee814a61ca43df0">HitFFWDButton</a>(XEvent* xe)
  3212. <a name="l03123"></a>03123 {
  3213. <a name="l03124"></a>03124 <span class="keywordflow">return</span> (
  3214. <a name="l03125"></a>03125 (xe-&gt;xbutton.button == Button1) &amp;&amp;
  3215. <a name="l03126"></a>03126 (xe-&gt;xbutton.x &gt;= FFWD_XL ) &amp;&amp;
  3216. <a name="l03127"></a>03127 (xe-&gt;xbutton.x &lt;= FFWD_XH ) &amp;&amp;
  3217. <a name="l03128"></a>03128 (xe-&gt;xbutton.y &gt;= FFWD_YL ) &amp;&amp;
  3218. <a name="l03129"></a>03129 (xe-&gt;xbutton.y &lt;= FFWD_YH ));
  3219. <a name="l03130"></a>03130 }
  3220. <a name="l03131"></a>03131
  3221. <a name="l03132"></a><a class="code" href="pumax_8c.html#aff6cd4c66b167fb04bc39da7db334ee1">03132</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#aff6cd4c66b167fb04bc39da7db334ee1">HitMinusButton</a>(XEvent* xe)
  3222. <a name="l03133"></a>03133 {
  3223. <a name="l03134"></a>03134 <span class="keywordflow">return</span> (
  3224. <a name="l03135"></a>03135 (xe-&gt;xbutton.button == Button1) &amp;&amp;
  3225. <a name="l03136"></a>03136 (xe-&gt;xbutton.x &gt;= Minus_XL ) &amp;&amp;
  3226. <a name="l03137"></a>03137 (xe-&gt;xbutton.x &lt;= Minus_XH ) &amp;&amp;
  3227. <a name="l03138"></a>03138 (xe-&gt;xbutton.y &gt;= Minus_YL ) &amp;&amp;
  3228. <a name="l03139"></a>03139 (xe-&gt;xbutton.y &lt;= Minus_YH ));
  3229. <a name="l03140"></a>03140 }
  3230. <a name="l03141"></a>03141
  3231. <a name="l03142"></a><a class="code" href="pumax_8c.html#a3f7d08865453b506505be1652fa245e6">03142</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a3f7d08865453b506505be1652fa245e6">HitFBWDButton</a>(XEvent* xe)
  3232. <a name="l03143"></a>03143 {
  3233. <a name="l03144"></a>03144 <span class="keywordflow">return</span> (
  3234. <a name="l03145"></a>03145 (xe-&gt;xbutton.button == Button1) &amp;&amp;
  3235. <a name="l03146"></a>03146 (xe-&gt;xbutton.x &gt;= FBWD_XL ) &amp;&amp;
  3236. <a name="l03147"></a>03147 (xe-&gt;xbutton.x &lt;= FBWD_XH ) &amp;&amp;
  3237. <a name="l03148"></a>03148 (xe-&gt;xbutton.y &gt;= FBWD_YL ) &amp;&amp;
  3238. <a name="l03149"></a>03149 (xe-&gt;xbutton.y &lt;= FBWD_YH ));
  3239. <a name="l03150"></a>03150 }
  3240. <a name="l03151"></a>03151
  3241. <a name="l03152"></a><a class="code" href="pumax_8c.html#ac492dd7b5f6a98f919a543e46699d8fc">03152</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ac492dd7b5f6a98f919a543e46699d8fc">HitUpperPanel</a>(XEvent* xe)
  3242. <a name="l03153"></a>03153 {
  3243. <a name="l03154"></a>03154 <span class="keywordflow">return</span> (
  3244. <a name="l03155"></a>03155 (xe-&gt;xbutton.button == Button1) &amp;&amp;
  3245. <a name="l03156"></a>03156 (xe-&gt;xbutton.x &gt;= Parc_XL ) &amp;&amp;
  3246. <a name="l03157"></a>03157 (xe-&gt;xbutton.x &lt;= Parc_XH ) &amp;&amp;
  3247. <a name="l03158"></a>03158 (xe-&gt;xbutton.y &gt;= Parc_YL-Parc_YD ) &amp;&amp;
  3248. <a name="l03159"></a>03159 (xe-&gt;xbutton.y &lt;= Parc_YL ));
  3249. <a name="l03160"></a>03160 }
  3250. <a name="l03161"></a>03161
  3251. <a name="l03162"></a><a class="code" href="pumax_8c.html#ad4ec717b0a474b6ff5e69793616e634b">03162</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ad4ec717b0a474b6ff5e69793616e634b">HitLowerPanel</a>(XEvent* xe)
  3252. <a name="l03163"></a>03163 {
  3253. <a name="l03164"></a>03164 <span class="keywordflow">return</span> (
  3254. <a name="l03165"></a>03165 (xe-&gt;xbutton.button == Button1) &amp;&amp;
  3255. <a name="l03166"></a>03166 (xe-&gt;xbutton.x &gt;= Parc_XL ) &amp;&amp;
  3256. <a name="l03167"></a>03167 (xe-&gt;xbutton.x &lt;= Parc_XH ) &amp;&amp;
  3257. <a name="l03168"></a>03168 (xe-&gt;xbutton.y &gt;= Parc_YH ) &amp;&amp;
  3258. <a name="l03169"></a>03169 (xe-&gt;xbutton.y &lt;= Parc_YH+Parc_YD));
  3259. <a name="l03170"></a>03170 }
  3260. <a name="l03171"></a>03171
  3261. <a name="l03172"></a><a class="code" href="pumax_8c.html#af8c4e537e83688ce6f731380cfa7a9fb">03172</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#af8c4e537e83688ce6f731380cfa7a9fb">HitWindowSelect</a>(XEvent* xe)
  3262. <a name="l03173"></a>03173 {
  3263. <a name="l03174"></a>03174 <span class="keywordflow">if</span> (
  3264. <a name="l03175"></a>03175 (xe-&gt;xbutton.button == Button1) &amp;&amp;
  3265. <a name="l03176"></a>03176 (xe-&gt;xbutton.x &gt;= Wbox_XL) &amp;&amp;
  3266. <a name="l03177"></a>03177 (xe-&gt;xbutton.x &lt;= Wbox_XH) &amp;&amp;
  3267. <a name="l03178"></a>03178 (xe-&gt;xbutton.y &gt;= Wbox_YL) &amp;&amp;
  3268. <a name="l03179"></a>03179 (xe-&gt;xbutton.y &lt;= Wbox_YH))
  3269. <a name="l03180"></a>03180 <span class="keywordflow">return</span> (xe-&gt;xbutton.y / FixFontHeight); <span class="comment">/* Window number */</span>
  3270. <a name="l03181"></a>03181 <span class="keywordflow">else</span> <span class="keywordflow">return</span> -1;
  3271. <a name="l03182"></a>03182 }
  3272. <a name="l03183"></a>03183
  3273. <a name="l03184"></a><a class="code" href="pumax_8c.html#af675133ed1eecfa06b0b58d820550268">03184</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#af675133ed1eecfa06b0b58d820550268">OnMouseClick</a>(<span class="keywordtype">void</span>)
  3274. <a name="l03185"></a>03185 {
  3275. <a name="l03186"></a>03186 <span class="keywordtype">int</span> w;
  3276. <a name="l03187"></a>03187
  3277. <a name="l03188"></a>03188 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a4ee12e86b4f071483510dac61cf7a92a">HitStopButton</a>(&amp;CowEvent))
  3278. <a name="l03189"></a>03189 {
  3279. <a name="l03190"></a>03190 Shutdown = 1;
  3280. <a name="l03191"></a>03191 }
  3281. <a name="l03192"></a>03192 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a9d02ed3207b28b02c7cc0ea8c3f51339">HitStartButton</a>(&amp;CowEvent))
  3282. <a name="l03193"></a>03193 {
  3283. <a name="l03194"></a>03194 Paused = 0;
  3284. <a name="l03195"></a>03195 XSetWMName(display,Cow,&amp;WinconName1);
  3285. <a name="l03196"></a>03196 }
  3286. <a name="l03197"></a>03197 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a535c697445b712fe16a24d9050968306">HitGridButton</a>(&amp;CowEvent))
  3287. <a name="l03198"></a>03198 {
  3288. <a name="l03199"></a>03199 Grid = !<a class="code" href="pumax_8c.html#a9666b9253809d418e00bcc929ee41c7d">Grid</a>;
  3289. <a name="l03200"></a>03200 <a class="code" href="pumax_8c.html#a2ddd057b95fbe6c728ffa0675b8d079f">ShowGridStatus</a>();
  3290. <a name="l03201"></a>03201 <span class="keywordflow">for</span> (w=0 ; w &lt; <a class="code" href="pumax_8c.html#a02d2c0dc228849a8b05c5e902a551ca9">NUMWIN</a> ; ++w) RedrawFlag[w] = 1;
  3291. <a name="l03202"></a>03202 }
  3292. <a name="l03203"></a>03203 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a2068accf6bb5b7d5b33dd6289b1f5f02">HitPauseButton</a>(&amp;CowEvent))
  3293. <a name="l03204"></a>03204 {
  3294. <a name="l03205"></a>03205 <span class="keywordflow">if</span> (Paused)
  3295. <a name="l03206"></a>03206 {
  3296. <a name="l03207"></a>03207 Paused = 0;
  3297. <a name="l03208"></a>03208 XSetWMName(display,Cow,&amp;WinconName1);
  3298. <a name="l03209"></a>03209 }
  3299. <a name="l03210"></a>03210 <span class="keywordflow">else</span>
  3300. <a name="l03211"></a>03211 {
  3301. <a name="l03212"></a>03212 Paused = 1;
  3302. <a name="l03213"></a>03213 XSetWMName(display,Cow,&amp;WinconPause);
  3303. <a name="l03214"></a>03214 }
  3304. <a name="l03215"></a>03215 }
  3305. <a name="l03216"></a>03216 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a15071e2ea43672ffd1cefb9c61903c75">HitHelpButton</a>(&amp;CowEvent))
  3306. <a name="l03217"></a>03217 {
  3307. <a name="l03218"></a>03218 <span class="keywordflow">if</span> (!HelpWindow) <a class="code" href="pumax_8c.html#a8a5aec9b47f5687c664df38d92daccf2">DisplayHelpWindow</a>();
  3308. <a name="l03219"></a>03219 }
  3309. <a name="l03220"></a>03220 <span class="keywordflow">else</span> <span class="keywordflow">if</span> ((w = <a class="code" href="pumax_8c.html#af8c4e537e83688ce6f731380cfa7a9fb">HitWindowSelect</a>(&amp;CowEvent)) &gt;= 0)
  3310. <a name="l03221"></a>03221 {
  3311. <a name="l03222"></a>03222 <span class="keywordflow">if</span> (Win[w]) <a class="code" href="pumax_8c.html#a64f109d6e1965c07709ba668a8e0e349">CloseWindow</a>(w);
  3312. <a name="l03223"></a>03223 <span class="keywordflow">else</span> <a class="code" href="pumax_8c.html#a3a74ca8916dc6e6193c5f4ef8abec8ea">ReopenWindow</a>(w);
  3313. <a name="l03224"></a>03224 }
  3314. <a name="l03225"></a>03225 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a426fec9e632373d9e59e1a060447b47d">HitPlusButton</a>(&amp;CowEvent))
  3315. <a name="l03226"></a>03226 {
  3316. <a name="l03227"></a>03227 <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[<a class="code" href="pumax_8c.html#ae660f447290dcbe0903af3b8bbff9450">cpi</a>].<a class="code" href="struct_parc_struct.html#a4901f0bf816a2d336307e9e3fcc95d82">Val</a> += <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[<a class="code" href="pumax_8c.html#ae660f447290dcbe0903af3b8bbff9450">cpi</a>].<a class="code" href="struct_parc_struct.html#a8228d63eefa1fb42c060ab069bcf2a1b">Inc</a>;
  3317. <a name="l03228"></a>03228 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[cpi].Val &gt; <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[cpi].Max) <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[<a class="code" href="pumax_8c.html#ae660f447290dcbe0903af3b8bbff9450">cpi</a>].<a class="code" href="struct_parc_struct.html#a4901f0bf816a2d336307e9e3fcc95d82">Val</a> = <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[<a class="code" href="pumax_8c.html#ae660f447290dcbe0903af3b8bbff9450">cpi</a>].<a class="code" href="struct_parc_struct.html#a01b1f457258f82282fdeeb6d8d4fbd8b">Max</a>;
  3318. <a name="l03229"></a>03229 }
  3319. <a name="l03230"></a>03230 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#aa59ba543293311702ee814a61ca43df0">HitFFWDButton</a>(&amp;CowEvent))
  3320. <a name="l03231"></a>03231 {
  3321. <a name="l03232"></a>03232 <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[<a class="code" href="pumax_8c.html#ae660f447290dcbe0903af3b8bbff9450">cpi</a>].<a class="code" href="struct_parc_struct.html#a4901f0bf816a2d336307e9e3fcc95d82">Val</a> += 10.0 * <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[<a class="code" href="pumax_8c.html#ae660f447290dcbe0903af3b8bbff9450">cpi</a>].<a class="code" href="struct_parc_struct.html#a8228d63eefa1fb42c060ab069bcf2a1b">Inc</a>;
  3322. <a name="l03233"></a>03233 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[cpi].Val &gt; <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[cpi].Max) <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[<a class="code" href="pumax_8c.html#ae660f447290dcbe0903af3b8bbff9450">cpi</a>].<a class="code" href="struct_parc_struct.html#a4901f0bf816a2d336307e9e3fcc95d82">Val</a> = <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[<a class="code" href="pumax_8c.html#ae660f447290dcbe0903af3b8bbff9450">cpi</a>].<a class="code" href="struct_parc_struct.html#a01b1f457258f82282fdeeb6d8d4fbd8b">Max</a>;
  3323. <a name="l03234"></a>03234 }
  3324. <a name="l03235"></a>03235 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#aff6cd4c66b167fb04bc39da7db334ee1">HitMinusButton</a>(&amp;CowEvent))
  3325. <a name="l03236"></a>03236 {
  3326. <a name="l03237"></a>03237 <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[<a class="code" href="pumax_8c.html#ae660f447290dcbe0903af3b8bbff9450">cpi</a>].<a class="code" href="struct_parc_struct.html#a4901f0bf816a2d336307e9e3fcc95d82">Val</a> -= <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[<a class="code" href="pumax_8c.html#ae660f447290dcbe0903af3b8bbff9450">cpi</a>].<a class="code" href="struct_parc_struct.html#a8228d63eefa1fb42c060ab069bcf2a1b">Inc</a>;
  3327. <a name="l03238"></a>03238 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[cpi].Val &lt; <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[cpi].Min) <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[<a class="code" href="pumax_8c.html#ae660f447290dcbe0903af3b8bbff9450">cpi</a>].<a class="code" href="struct_parc_struct.html#a4901f0bf816a2d336307e9e3fcc95d82">Val</a> = <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[<a class="code" href="pumax_8c.html#ae660f447290dcbe0903af3b8bbff9450">cpi</a>].<a class="code" href="struct_parc_struct.html#a2a2d6960e03fa37291f0fff4402f4a38">Min</a>;
  3328. <a name="l03239"></a>03239 }
  3329. <a name="l03240"></a>03240 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a3f7d08865453b506505be1652fa245e6">HitFBWDButton</a>(&amp;CowEvent))
  3330. <a name="l03241"></a>03241 {
  3331. <a name="l03242"></a>03242 <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[<a class="code" href="pumax_8c.html#ae660f447290dcbe0903af3b8bbff9450">cpi</a>].<a class="code" href="struct_parc_struct.html#a4901f0bf816a2d336307e9e3fcc95d82">Val</a> -= 10.0 * <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[<a class="code" href="pumax_8c.html#ae660f447290dcbe0903af3b8bbff9450">cpi</a>].<a class="code" href="struct_parc_struct.html#a8228d63eefa1fb42c060ab069bcf2a1b">Inc</a>;
  3332. <a name="l03243"></a>03243 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[cpi].Val &lt; <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[cpi].Min) <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[<a class="code" href="pumax_8c.html#ae660f447290dcbe0903af3b8bbff9450">cpi</a>].<a class="code" href="struct_parc_struct.html#a4901f0bf816a2d336307e9e3fcc95d82">Val</a> = <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[<a class="code" href="pumax_8c.html#ae660f447290dcbe0903af3b8bbff9450">cpi</a>].<a class="code" href="struct_parc_struct.html#a2a2d6960e03fa37291f0fff4402f4a38">Min</a>;
  3333. <a name="l03244"></a>03244 }
  3334. <a name="l03245"></a>03245 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#ac492dd7b5f6a98f919a543e46699d8fc">HitUpperPanel</a>(&amp;CowEvent) &amp;&amp; cpi &gt; 0) --<a class="code" href="pumax_8c.html#ae660f447290dcbe0903af3b8bbff9450">cpi</a>;
  3335. <a name="l03246"></a>03246 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#ad4ec717b0a474b6ff5e69793616e634b">HitLowerPanel</a>(&amp;CowEvent) &amp;&amp; cpi &lt; Parcs-1) ++<a class="code" href="pumax_8c.html#ae660f447290dcbe0903af3b8bbff9450">cpi</a>;
  3336. <a name="l03247"></a>03247 }
  3337. <a name="l03248"></a>03248
  3338. <a name="l03249"></a>03249
  3339. <a name="l03250"></a><a class="code" href="pumax_8c.html#ac78f1f279638bfd177687a680c4c21ce">03250</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#ac78f1f279638bfd177687a680c4c21ce">SwitchIndez</a>(<span class="keywordtype">int</span> w, <span class="keywordtype">int</span> d)
  3340. <a name="l03251"></a>03251 {
  3341. <a name="l03252"></a>03252 <span class="keywordtype">int</span> jlat;
  3342. <a name="l03253"></a>03253 <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> delphi;
  3343. <a name="l03254"></a>03254 <span class="keywordtype">char</span> *lpt;
  3344. <a name="l03255"></a>03255 <span class="keywordtype">char</span> levstr[20];
  3345. <a name="l03256"></a>03256
  3346. <a name="l03257"></a>03257 <span class="keywordflow">if</span> (Indez[w] &lt; 0 || Indez[w] &gt;= MaxZ[w])
  3347. <a name="l03258"></a>03258 {
  3348. <a name="l03259"></a>03259 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">Debug</a>) printf(<span class="stringliteral">&quot;### Indez[%d] = %d\n&quot;</span>,w,Indez[w]);
  3349. <a name="l03260"></a>03260 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">Debug</a>) printf(<span class="stringliteral">&quot;### MaxZ[%d] = %d\n&quot;</span>,w, MaxZ[w]);
  3350. <a name="l03261"></a>03261 Indez[w] = 0;
  3351. <a name="l03262"></a>03262 }
  3352. <a name="l03263"></a>03263 <span class="keywordflow">if</span> (Indez[w]+d &lt; 0 ) <span class="keywordflow">return</span>;
  3353. <a name="l03264"></a>03264 <span class="keywordflow">if</span> (Indez[w]+d &gt;= MaxZ[w]) <span class="keywordflow">return</span>;
  3354. <a name="l03265"></a>03265 Indez[w] += d;
  3355. <a name="l03266"></a>03266 lpt = strstr(WindowTitle[w],<span class="stringliteral">&quot;Level&quot;</span>);
  3356. <a name="l03267"></a>03267 <span class="keywordflow">if</span> (lpt)
  3357. <a name="l03268"></a>03268 {
  3358. <a name="l03269"></a>03269 sprintf(levstr,<span class="stringliteral">&quot; %d&quot;</span>,Indez[w]+1);
  3359. <a name="l03270"></a>03270 strcpy(lpt+5,levstr);
  3360. <a name="l03271"></a>03271 XStringListToTextProperty(&amp;WindowTitle[w],1,WindowName+w);
  3361. <a name="l03272"></a>03272 XSetWMProperties(display,Win[w],WindowName+w,NULL,
  3362. <a name="l03273"></a>03273 NULL,0,&amp;WinSizeHints,&amp;wm_hints,&amp;class_hints);
  3363. <a name="l03274"></a>03274 LevelChanged[w] = 1;
  3364. <a name="l03275"></a>03275 <span class="keywordflow">return</span>;
  3365. <a name="l03276"></a>03276 }
  3366. <a name="l03277"></a>03277 lpt = strstr(WindowTitle[w],<span class="stringliteral">&quot;Latitude&quot;</span>);
  3367. <a name="l03278"></a>03278 <span class="keywordflow">if</span> (lpt)
  3368. <a name="l03279"></a>03279 {
  3369. <a name="l03280"></a>03280 delphi = 180.0 / MaxZ[w];
  3370. <a name="l03281"></a>03281 jlat = 90.0 -Indez[w] * delphi - delphi * 0.5;
  3371. <a name="l03282"></a>03282 <span class="keywordflow">if</span> (jlat &gt; 0) sprintf(levstr,<span class="stringliteral">&quot; %dN&quot;</span>, jlat);
  3372. <a name="l03283"></a>03283 <span class="keywordflow">else</span> sprintf(levstr,<span class="stringliteral">&quot; %dS&quot;</span>,-jlat);
  3373. <a name="l03284"></a>03284 strcpy(lpt+8,levstr);
  3374. <a name="l03285"></a>03285 XStringListToTextProperty(&amp;WindowTitle[w],1,WindowName+w);
  3375. <a name="l03286"></a>03286 XSetWMProperties(display,Win[w],WindowName+w,NULL,
  3376. <a name="l03287"></a>03287 NULL,0,&amp;WinSizeHints,&amp;wm_hints,&amp;class_hints);
  3377. <a name="l03288"></a>03288 <span class="keywordflow">return</span>;
  3378. <a name="l03289"></a>03289 }
  3379. <a name="l03290"></a>03290 }
  3380. <a name="l03291"></a>03291
  3381. <a name="l03292"></a>03292
  3382. <a name="l03293"></a><a class="code" href="pumax_8c.html#a5d7b22836449266ba8bd29a5f83e3c2b">03293</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a5d7b22836449266ba8bd29a5f83e3c2b">HandleEvents</a>(<span class="keywordtype">void</span>)
  3383. <a name="l03294"></a>03294 {
  3384. <a name="l03295"></a>03295 <span class="keywordtype">int</span> w,Key,KeyIndex;
  3385. <a name="l03296"></a>03296 XEvent WinEvent;
  3386. <a name="l03297"></a>03297
  3387. <a name="l03298"></a>03298 <span class="keywordflow">if</span> (nstep == 1)
  3388. <a name="l03299"></a>03299 {
  3389. <a name="l03300"></a>03300 <a class="code" href="pumax_8c.html#a41f77efa657ce06e158034152384bf2e">RedrawControlWindow</a>();
  3390. <a name="l03301"></a>03301 Paused = 1; <span class="comment">/* Start in pause mode */</span>
  3391. <a name="l03302"></a>03302 }
  3392. <a name="l03303"></a>03303
  3393. <a name="l03304"></a>03304
  3394. <a name="l03305"></a>03305 <span class="keywordflow">do</span>
  3395. <a name="l03306"></a>03306 {
  3396. <a name="l03307"></a>03307 <span class="comment">/* Check for Termination */</span>
  3397. <a name="l03308"></a>03308
  3398. <a name="l03309"></a>03309 <span class="keywordflow">if</span> (XCheckTypedWindowEvent(display,Cow,ClientMessage,&amp;WinEvent))
  3399. <a name="l03310"></a>03310 {
  3400. <a name="l03311"></a>03311 <span class="comment">/* printf(&quot;delwin %d\n&quot;,WinEvent.xclient.data.l[0]); */</span>
  3401. <a name="l03312"></a>03312 Shutdown = 1;
  3402. <a name="l03313"></a>03313 <span class="keywordflow">return</span>;
  3403. <a name="l03314"></a>03314 }
  3404. <a name="l03315"></a>03315
  3405. <a name="l03316"></a>03316 <span class="comment">/* Check for user request to close windows */</span>
  3406. <a name="l03317"></a>03317
  3407. <a name="l03318"></a>03318 <span class="keywordflow">for</span> (w=0 ; w &lt; <a class="code" href="pumax_8c.html#a2364498cd60ebd2201eeef32ce76e882">NumWin</a> ; ++w)
  3408. <a name="l03319"></a>03319 <span class="keywordflow">if</span> (Win[w])
  3409. <a name="l03320"></a>03320 {
  3410. <a name="l03321"></a>03321 <span class="keywordflow">if</span> (XCheckTypedWindowEvent(display,Win[w],ClientMessage,&amp;WinEvent))
  3411. <a name="l03322"></a>03322 <a class="code" href="pumax_8c.html#a64f109d6e1965c07709ba668a8e0e349">CloseWindow</a>(w);
  3412. <a name="l03323"></a>03323 }
  3413. <a name="l03324"></a>03324
  3414. <a name="l03325"></a>03325 <span class="comment">/* Check for user request to close help window */</span>
  3415. <a name="l03326"></a>03326
  3416. <a name="l03327"></a>03327 <span class="keywordflow">if</span> (HelpWindow &amp;&amp; XCheckTypedWindowEvent(display,HelpWindow,ClientMessage,&amp;WinEvent))
  3417. <a name="l03328"></a>03328 {
  3418. <a name="l03329"></a>03329 XDestroyWindow(display,HelpWindow);
  3419. <a name="l03330"></a>03330 HelpWindow = 0;
  3420. <a name="l03331"></a>03331 }
  3421. <a name="l03332"></a>03332
  3422. <a name="l03333"></a>03333 <span class="comment">/* Check for mouse click */</span>
  3423. <a name="l03334"></a>03334
  3424. <a name="l03335"></a>03335 <span class="keywordflow">if</span> (XCheckTypedWindowEvent(display,Cow,ButtonPress,&amp;CowEvent))
  3425. <a name="l03336"></a>03336 {
  3426. <a name="l03337"></a>03337 <a class="code" href="pumax_8c.html#af675133ed1eecfa06b0b58d820550268">OnMouseClick</a>();
  3427. <a name="l03338"></a>03338 <a class="code" href="pumax_8c.html#a41f77efa657ce06e158034152384bf2e">RedrawControlWindow</a>();
  3428. <a name="l03339"></a>03339 }
  3429. <a name="l03340"></a>03340
  3430. <a name="l03341"></a>03341 <span class="comment">/* Check for mouseclicks and expose events */</span>
  3431. <a name="l03342"></a>03342
  3432. <a name="l03343"></a>03343 <span class="keywordflow">for</span> (w=0 ; w &lt; <a class="code" href="pumax_8c.html#a2364498cd60ebd2201eeef32ce76e882">NumWin</a> ; ++w)
  3433. <a name="l03344"></a>03344 <span class="keywordflow">if</span> (Win[w])
  3434. <a name="l03345"></a>03345 {
  3435. <a name="l03346"></a>03346 <span class="keywordflow">if</span> (XCheckTypedWindowEvent(display,Win[w],ButtonPress,&amp;CowEvent))
  3436. <a name="l03347"></a>03347 {
  3437. <a name="l03348"></a>03348 <span class="keywordflow">if</span> (CowEvent.xbutton.button == Button1) <a class="code" href="pumax_8c.html#ac78f1f279638bfd177687a680c4c21ce">SwitchIndez</a>(w,-1);
  3438. <a name="l03349"></a>03349 <span class="keywordflow">if</span> (CowEvent.xbutton.button == Button3) <a class="code" href="pumax_8c.html#ac78f1f279638bfd177687a680c4c21ce">SwitchIndez</a>(w, 1);
  3439. <a name="l03350"></a>03350 <span class="keywordflow">if</span> (CowEvent.xbutton.button == Button2)
  3440. <a name="l03351"></a>03351 {
  3441. <a name="l03352"></a>03352 <span class="keywordflow">if</span> (++MapPro[w] &gt;= <a class="code" href="pumax_8c.html#a3b66883efb152a59e42802d74245ae5a">MAXMAPS</a>) MapPro[w] = 0;
  3442. <a name="l03353"></a>03353 <span class="keywordflow">if</span> (MapPro[w] == <a class="code" href="pumax_8c.html#aae4090be0e30c18b0f22650479767d8f">AZIMUTHAL</a> &amp;&amp;
  3443. <a name="l03354"></a>03354 (<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].Plot != <a class="code" href="pumax_8c.html#a3e3bcad4c273544328bcdcaef35c3852">MAPHOR</a> &amp;&amp; <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].Plot != <a class="code" href="pumax_8c.html#a1572b520f538d357372e96d0185275e5">MAPTRA</a>))
  3444. <a name="l03355"></a>03355 MapPro[w] = 0;
  3445. <a name="l03356"></a>03356 }
  3446. <a name="l03357"></a>03357 RedrawFlag[w] = 1;
  3447. <a name="l03358"></a>03358 }
  3448. <a name="l03359"></a>03359 <span class="keywordflow">if</span> (XCheckTypedWindowEvent(display,Win[w],KeyPress,&amp;CowEvent))
  3449. <a name="l03360"></a>03360 {
  3450. <a name="l03361"></a>03361 KeyIndex = (CowEvent.xkey.keycode - <a class="code" href="pumax_8c.html#a7d187d3be57e785fee45a7dfc5475595">FirstKey</a>) * SymsPerKey;
  3451. <a name="l03362"></a>03362 Key = KeyMap[KeyIndex];
  3452. <a name="l03363"></a>03363 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">Debug</a>) printf(<span class="stringliteral">&quot;Windows %d got keyindex %d with symbol %x\n&quot;</span>,w,KeyIndex,Key);
  3453. <a name="l03364"></a>03364 <span class="keywordflow">if</span> (Key == <a class="code" href="pumax_8c.html#ae880d2ccffb14a9a68b859d09f22e12a">ROTATE_LEFT</a> &amp;&amp; <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].f &lt; 5) <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].<a class="code" href="struct_map_image_struct.html#a7c3018a3883c438e08c5632a49e39c66">f</a>++;
  3454. <a name="l03365"></a>03365 <span class="keywordflow">if</span> (Key == <a class="code" href="pumax_8c.html#a03653d3bb216e366e5f0144e79554a39">ROTATE_RIGHT</a> &amp;&amp; <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].f &gt; -5) <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].<a class="code" href="struct_map_image_struct.html#a7c3018a3883c438e08c5632a49e39c66">f</a>--;
  3455. <a name="l03366"></a>03366 <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].<a class="code" href="struct_map_image_struct.html#a0c135dc0852d411fd87b7ac84ba55664">r</a> = <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].<a class="code" href="struct_map_image_struct.html#a7c3018a3883c438e08c5632a49e39c66">f</a> * <a class="code" href="pumax_8c.html#aa62b318359708cb3e3c6f55cac884a6f">RotInc</a>;
  3456. <a name="l03367"></a>03367 <span class="keywordflow">if</span> (Key == XK_Up ) <a class="code" href="pumax_8c.html#ac78f1f279638bfd177687a680c4c21ce">SwitchIndez</a>(w,-1);
  3457. <a name="l03368"></a>03368 <span class="keywordflow">if</span> (Key == XK_Down) <a class="code" href="pumax_8c.html#ac78f1f279638bfd177687a680c4c21ce">SwitchIndez</a>(w, 1);
  3458. <a name="l03369"></a>03369 }
  3459. <a name="l03370"></a>03370 <span class="keywordflow">if</span> (Paused)
  3460. <a name="l03371"></a>03371 <span class="keywordflow">if</span> (XCheckTypedWindowEvent(display,Win[w],Expose,&amp;CowEvent))
  3461. <a name="l03372"></a>03372 <a class="code" href="pumax_8c.html#a2f9a1f5b15d5b0b8305a40270b38ab97">RedrawIsoWindow</a>(w);
  3462. <a name="l03373"></a>03373 }
  3463. <a name="l03374"></a>03374
  3464. <a name="l03375"></a>03375 <span class="keywordflow">if</span> (XCheckTypedWindowEvent(display,Cow,Expose,&amp;CowEvent))
  3465. <a name="l03376"></a>03376 <a class="code" href="pumax_8c.html#a41f77efa657ce06e158034152384bf2e">RedrawControlWindow</a>();
  3466. <a name="l03377"></a>03377
  3467. <a name="l03378"></a>03378 <span class="keywordflow">if</span> (HelpWindow &amp;&amp; XCheckTypedWindowEvent(display,HelpWindow,Expose,&amp;CowEvent))
  3468. <a name="l03379"></a>03379 <a class="code" href="pumax_8c.html#aba750e7646eb34565d33fea6f31b676b">DrawHelpWindow</a>();
  3469. <a name="l03380"></a>03380
  3470. <a name="l03381"></a>03381 } <span class="keywordflow">while</span> (Paused &amp;&amp; !Shutdown);
  3471. <a name="l03382"></a>03382 }
  3472. <a name="l03383"></a>03383
  3473. <a name="l03384"></a><a class="code" href="pumax_8c.html#a3e6d6484cbc802c71aa4d660b3e6298c">03384</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a3e6d6484cbc802c71aa4d660b3e6298c">guiclose_</a>(<span class="keywordtype">void</span>)
  3474. <a name="l03385"></a>03385 {
  3475. <a name="l03386"></a>03386 <span class="keywordtype">int</span> w;
  3476. <a name="l03387"></a>03387
  3477. <a name="l03388"></a>03388 <span class="keywordflow">if</span> (MRpid &gt;= 0) <span class="keywordflow">return</span>; <span class="comment">// Don&#39;t wait if multiple instances</span>
  3478. <a name="l03389"></a>03389 XSetWMName(display,Cow,&amp;WinconName3);
  3479. <a name="l03390"></a>03390
  3480. <a name="l03391"></a>03391 <span class="keywordflow">do</span>
  3481. <a name="l03392"></a>03392 {
  3482. <a name="l03393"></a>03393 <span class="keywordflow">for</span> (w=0 ; w &lt; <a class="code" href="pumax_8c.html#a2364498cd60ebd2201eeef32ce76e882">NumWin</a> ; ++w)
  3483. <a name="l03394"></a>03394 <span class="keywordflow">if</span> (Win[w])
  3484. <a name="l03395"></a>03395 {
  3485. <a name="l03396"></a>03396 <span class="keywordflow">if</span> (XCheckTypedWindowEvent(display,Win[w],Expose,&amp;CowEvent))
  3486. <a name="l03397"></a>03397 <a class="code" href="pumax_8c.html#a2f9a1f5b15d5b0b8305a40270b38ab97">RedrawIsoWindow</a>(w);
  3487. <a name="l03398"></a>03398 }
  3488. <a name="l03399"></a>03399
  3489. <a name="l03400"></a>03400 <span class="keywordflow">if</span> (XCheckTypedWindowEvent(display,Cow,Expose,&amp;CowEvent))
  3490. <a name="l03401"></a>03401 <a class="code" href="pumax_8c.html#a41f77efa657ce06e158034152384bf2e">RedrawControlWindow</a>();
  3491. <a name="l03402"></a>03402 }
  3492. <a name="l03403"></a>03403 <span class="keywordflow">while</span> (!(XCheckTypedWindowEvent(display,Cow,ButtonPress,&amp;CowEvent) &amp;&amp;
  3493. <a name="l03404"></a>03404 <a class="code" href="pumax_8c.html#a4ee12e86b4f071483510dac61cf7a92a">HitStopButton</a>(&amp;CowEvent)));
  3494. <a name="l03405"></a>03405
  3495. <a name="l03406"></a>03406 <span class="comment">// XCloseDisplay(display); // segmentation fault on sun compiler!</span>
  3496. <a name="l03407"></a>03407 }
  3497. <a name="l03408"></a>03408
  3498. <a name="l03409"></a><a class="code" href="pumax_8c.html#aeddd52f215d48c55293dfbc55156c780">03409</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#aeddd52f215d48c55293dfbc55156c780">SaveConfig</a>(<span class="keywordtype">void</span>)
  3499. <a name="l03410"></a>03410 {
  3500. <a name="l03411"></a>03411 <span class="keywordtype">int</span> i;
  3501. <a name="l03412"></a>03412 FILE *scp;
  3502. <a name="l03413"></a>03413 <a class="code" href="pumax_8c.html#a83e35c70462fc81d9b622790c8661e8e">INTXS</a> X,Y,xp,yp;
  3503. <a name="l03414"></a>03414 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> w,W,H,border,depth;
  3504. <a name="l03415"></a>03415 Window Rootwin,Child;
  3505. <a name="l03416"></a>03416 XWindowAttributes RootAtt;
  3506. <a name="l03417"></a>03417
  3507. <a name="l03418"></a>03418 scp = fopen(GUI_config,<span class="stringliteral">&quot;w&quot;</span>);
  3508. <a name="l03419"></a>03419 <span class="keywordflow">if</span> (scp == NULL) <span class="keywordflow">return</span>;
  3509. <a name="l03420"></a>03420
  3510. <a name="l03421"></a>03421 <span class="comment">/* Save window properties */</span>
  3511. <a name="l03422"></a>03422
  3512. <a name="l03423"></a>03423 fprintf(scp,<span class="stringliteral">&quot;Hamburg GUI Config File Version 16\n&quot;</span>);
  3513. <a name="l03424"></a>03424 fprintf(scp,<span class="stringliteral">&quot;Screen: %dx%d\n\n&quot;</span>,ScreenW,ScreenH);
  3514. <a name="l03425"></a>03425 fprintf(scp,<span class="stringliteral">&quot;WinRows = %d\n&quot;</span>,WinRows);
  3515. <a name="l03426"></a>03426 fprintf(scp,<span class="stringliteral">&quot;WinCols = %d\n&quot;</span>,WinCols);
  3516. <a name="l03427"></a>03427 <span class="keywordflow">for</span> (w=0 ; w &lt; <a class="code" href="pumax_8c.html#a2364498cd60ebd2201eeef32ce76e882">NumWin</a> ; ++w)
  3517. <a name="l03428"></a>03428 {
  3518. <a name="l03429"></a>03429 fprintf(scp,<span class="stringliteral">&quot;\n[Window %02d]\n&quot;</span>,w);
  3519. <a name="l03430"></a>03430 fprintf(scp,<span class="stringliteral">&quot;Array:%s\n&quot;</span>,<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].array_name);
  3520. <a name="l03431"></a>03431 fprintf(scp,<span class="stringliteral">&quot;Plot:%s\n&quot;</span>,<a class="code" href="pumax_8c.html#a521281f5e10ed8f5e4cdb50ead3b2612">IsoNames</a>[<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].Plot]);
  3521. <a name="l03432"></a>03432 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].Plot == <a class="code" href="pumax_8c.html#a2f1d89ef346ef5189b556085f4553c4c">ISOHOR</a> || <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].Plot == <a class="code" href="pumax_8c.html#a3e3bcad4c273544328bcdcaef35c3852">MAPHOR</a> ||
  3522. <a name="l03433"></a>03433 <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].Plot == <a class="code" href="pumax_8c.html#a4c30d0a50533694deda0fcf3551b6935">ISOTRA</a> || <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].Plot == <a class="code" href="pumax_8c.html#a1572b520f538d357372e96d0185275e5">MAPTRA</a>)
  3523. <a name="l03434"></a>03434 {
  3524. <a name="l03435"></a>03435 fprintf(scp,<span class="stringliteral">&quot;Projection:%s\n&quot;</span>,ProNames[MapPro[w]]);
  3525. <a name="l03436"></a>03436 fprintf(scp,<span class="stringliteral">&quot;Rotation factor:%d\n&quot;</span>,<a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].f);
  3526. <a name="l03437"></a>03437 }
  3527. <a name="l03438"></a>03438 fprintf(scp,<span class="stringliteral">&quot;Palette:%s\n&quot;</span>,PalNames[<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].Palette]);
  3528. <a name="l03439"></a>03439 fprintf(scp,<span class="stringliteral">&quot;Title:%s\n&quot;</span>,WindowTitle[w]+wto);
  3529. <a name="l03440"></a>03440 <span class="keywordflow">if</span> (Win[w])
  3530. <a name="l03441"></a>03441 {
  3531. <a name="l03442"></a>03442 XGetGeometry(display,Win[w],&amp;Rootwin,&amp;xp,&amp;yp,&amp;W,&amp;H,&amp;border,&amp;depth);
  3532. <a name="l03443"></a>03443 XTranslateCoordinates(display,Win[w],Rootwin,0,0,&amp;X,&amp;Y,&amp;Child);
  3533. <a name="l03444"></a>03444 fprintf(scp,<span class="stringliteral">&quot;Geometry: %4d %4d %4d %4d\n&quot;</span>,W,H,X-WinLM,Y-WinTM);
  3534. <a name="l03445"></a>03445 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">Debug</a>)
  3535. <a name="l03446"></a>03446 {
  3536. <a name="l03447"></a>03447 printf(<span class="stringliteral">&quot;Geometry Window %d [%8x]: %4d / %4d %4d x %4d x %2d | %d\n&quot;</span>,
  3537. <a name="l03448"></a>03448 w,(<span class="keywordtype">int</span>)Win[w],xp,yp,W,H,depth,border);
  3538. <a name="l03449"></a>03449 printf(<span class="stringliteral">&quot;Translated UL corner: %4d / %4d\n&quot;</span>,X,Y);
  3539. <a name="l03450"></a>03450 }
  3540. <a name="l03451"></a>03451 }
  3541. <a name="l03452"></a>03452 <span class="keywordflow">else</span>
  3542. <a name="l03453"></a>03453 fprintf(scp,<span class="stringliteral">&quot;Inactive: %4d %4d %4d %4d\n&quot;</span>,
  3543. <a name="l03454"></a>03454 <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].w,<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].h,<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].x,<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].y);
  3544. <a name="l03455"></a>03455 }
  3545. <a name="l03456"></a>03456 XGetGeometry(display,Cow,&amp;Rootwin,&amp;xp,&amp;yp,&amp;W,&amp;H,&amp;border,&amp;depth);
  3546. <a name="l03457"></a>03457 XTranslateCoordinates(display,Cow,Rootwin,0,0,&amp;X,&amp;Y,&amp;Child);
  3547. <a name="l03458"></a>03458 fprintf(scp,<span class="stringliteral">&quot;\n[Control Window]\n&quot;</span>);
  3548. <a name="l03459"></a>03459 fprintf(scp,<span class="stringliteral">&quot;Geometry: %4d %4d %4d %4d\n&quot;</span>,W,H,X-WinLM,Y-WinTM);
  3549. <a name="l03460"></a>03460
  3550. <a name="l03461"></a>03461 <span class="comment">/* Scalar attributes for timeseries and tables */</span>
  3551. <a name="l03462"></a>03462
  3552. <a name="l03463"></a>03463 fprintf(scp,<span class="stringliteral">&quot;\n# Scalar attributes for timeseries and table window\n&quot;</span>);
  3553. <a name="l03464"></a>03464
  3554. <a name="l03465"></a>03465 <span class="keywordflow">for</span> (i=0 ; i &lt; <a class="code" href="pumax_8c.html#a4444b7b37748213e596d8d51dfdb3315">Parcs</a> ; ++i)
  3555. <a name="l03466"></a>03466 {
  3556. <a name="l03467"></a>03467 fprintf(scp,<span class="stringliteral">&quot;\n[Scalar %02d]\n&quot;</span>,i);
  3557. <a name="l03468"></a>03468 fprintf(scp,<span class="stringliteral">&quot;Name:%s\n&quot;</span>,TSName[i]);
  3558. <a name="l03469"></a>03469 fprintf(scp,<span class="stringliteral">&quot;Sub:%s\n&quot;</span>,TSubsc[i]);
  3559. <a name="l03470"></a>03470 fprintf(scp,<span class="stringliteral">&quot;Unit:%s\n&quot;</span>,TSUnit[i]);
  3560. <a name="l03471"></a>03471 fprintf(scp,<span class="stringliteral">&quot;Scale:%s\n&quot;</span>,TScale[i]);
  3561. <a name="l03472"></a>03472 }
  3562. <a name="l03473"></a>03473
  3563. <a name="l03474"></a>03474 <span class="comment">/* Scalar attributes for timeseries and tables */</span>
  3564. <a name="l03475"></a>03475
  3565. <a name="l03476"></a>03476 fprintf(scp,<span class="stringliteral">&quot;\n# Parameter attributes for change menu\n&quot;</span>);
  3566. <a name="l03477"></a>03477
  3567. <a name="l03478"></a>03478 <span class="keywordflow">for</span> (i=0 ; i &lt; <a class="code" href="pumax_8c.html#a82714a35091aa707ef0bc4c0ad18d7b2">NUMSCALARS</a> ; ++i)
  3568. <a name="l03479"></a>03479 {
  3569. <a name="l03480"></a>03480 <span class="keywordflow">if</span> (strlen(<a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[i].Name) == 0) <span class="keywordflow">break</span>;
  3570. <a name="l03481"></a>03481 fprintf(scp,<span class="stringliteral">&quot;\n[Parameter %02d]\n&quot;</span>,i);
  3571. <a name="l03482"></a>03482 fprintf(scp,<span class="stringliteral">&quot;ParName:%s\n&quot;</span>,<a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[i].Name);
  3572. <a name="l03483"></a>03483 fprintf(scp,<span class="stringliteral">&quot;ParInc:%10.4f\n&quot;</span>,<a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[i].Inc);
  3573. <a name="l03484"></a>03484 fprintf(scp,<span class="stringliteral">&quot;ParMin:%10.4f\n&quot;</span>,<a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[i].Min);
  3574. <a name="l03485"></a>03485 fprintf(scp,<span class="stringliteral">&quot;ParMax:%10.4f\n&quot;</span>,<a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[i].Max);
  3575. <a name="l03486"></a>03486 }
  3576. <a name="l03487"></a>03487
  3577. <a name="l03488"></a>03488 fclose(scp);
  3578. <a name="l03489"></a>03489 }
  3579. <a name="l03490"></a>03490
  3580. <a name="l03491"></a>03491
  3581. <a name="l03492"></a><a class="code" href="pumax_8c.html#a47d2c6cfb8dd4bebb935c05cb54c9148">03492</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a47d2c6cfb8dd4bebb935c05cb54c9148">lp2ps</a>(<a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> *a, <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> *b)
  3582. <a name="l03493"></a>03493 {
  3583. <a name="l03494"></a>03494 <span class="keywordtype">int</span> i,j,k,l,k1,l1;
  3584. <a name="l03495"></a>03495 <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> xnp,ynp,xsp,ysp,dx,dy,x,y,lfa,ua,ub;
  3585. <a name="l03496"></a>03496
  3586. <a name="l03497"></a>03497 lfa = (DimX-1) / (2.0 * M_PI);
  3587. <a name="l03498"></a>03498 xnp = (DimX-1) * 0.25;
  3588. <a name="l03499"></a>03499 ynp = (DimY-1) * 0.50;
  3589. <a name="l03500"></a>03500 xsp = (DimX-1) * 0.75;
  3590. <a name="l03501"></a>03501 ysp = ynp;
  3591. <a name="l03502"></a>03502
  3592. <a name="l03503"></a>03503 <span class="comment">/* Northern hemisphere */</span>
  3593. <a name="l03504"></a>03504
  3594. <a name="l03505"></a>03505 <span class="keywordflow">for</span> (j = 0 ; j &lt; <a class="code" href="pumax_8c.html#ace2f02cb6559cc7f528a995935d30878">DimY</a> ; ++j)
  3595. <a name="l03506"></a>03506 <span class="keywordflow">for</span> (i = 0 ; i &lt;= DimX/2 ; ++i)
  3596. <a name="l03507"></a>03507 {
  3597. <a name="l03508"></a>03508 dx = xnp - i;
  3598. <a name="l03509"></a>03509 dy = ynp - j;
  3599. <a name="l03510"></a>03510 x = atan2(dx,dy) * lfa;
  3600. <a name="l03511"></a>03511 y = sqrt(dx * dx + dy * dy);
  3601. <a name="l03512"></a>03512 <span class="keywordflow">if</span> (x &lt; 0.0) x += (DimX-1);
  3602. <a name="l03513"></a>03513 k = x;
  3603. <a name="l03514"></a>03514 l = y;
  3604. <a name="l03515"></a>03515 k1 = k + 1;
  3605. <a name="l03516"></a>03516 <span class="keywordflow">if</span> (k1 &gt;= DimX) k1 = 0;
  3606. <a name="l03517"></a>03517 <span class="keywordflow">if</span> (l &lt;= DimY/2+1)
  3607. <a name="l03518"></a>03518 {
  3608. <a name="l03519"></a>03519 ua = (k+1-x) * a[k+l*DimX] + (x-k) * a[k1+l*<a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>];
  3609. <a name="l03520"></a>03520 ub = (k+1-x) * a[k+(l+1)*<a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>] + (x-k) * a[k+1+(l+1)*<a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>];
  3610. <a name="l03521"></a>03521 b[i+j*<a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>] = (l+1-y) * ua + (y-l) * ub;
  3611. <a name="l03522"></a>03522 }
  3612. <a name="l03523"></a>03523 <span class="keywordflow">else</span> b[i+j*<a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>] = - 99999.0;
  3613. <a name="l03524"></a>03524 }
  3614. <a name="l03525"></a>03525
  3615. <a name="l03526"></a>03526 <span class="comment">/* Souhern hemisphere */</span>
  3616. <a name="l03527"></a>03527
  3617. <a name="l03528"></a>03528 <span class="keywordflow">for</span> (j = 0 ; j &lt; <a class="code" href="pumax_8c.html#ace2f02cb6559cc7f528a995935d30878">DimY</a> ; ++j)
  3618. <a name="l03529"></a>03529 <span class="keywordflow">for</span> (i = DimX/2+1 ; i &lt; <a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a> ; ++i)
  3619. <a name="l03530"></a>03530 {
  3620. <a name="l03531"></a>03531 dx = i - xsp;
  3621. <a name="l03532"></a>03532 dy = ysp - j;
  3622. <a name="l03533"></a>03533 x = atan2(dx,dy) * lfa;
  3623. <a name="l03534"></a>03534 y = (DimY-1) - sqrt(dx * dx + dy * dy);
  3624. <a name="l03535"></a>03535 <span class="keywordflow">if</span> (x &lt; 0.0) x += (DimX-1);
  3625. <a name="l03536"></a>03536 k = x;
  3626. <a name="l03537"></a>03537 l = y;
  3627. <a name="l03538"></a>03538 k1 = k + 1;
  3628. <a name="l03539"></a>03539 <span class="keywordflow">if</span> (k1 &gt;= DimX) k1 = 0;
  3629. <a name="l03540"></a>03540 <span class="keywordflow">if</span> (l &gt;= DimY/2-3)
  3630. <a name="l03541"></a>03541 {
  3631. <a name="l03542"></a>03542 ua = (k+1-x) * a[k+l*DimX] + (x-k) * a[k1+l*<a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>];
  3632. <a name="l03543"></a>03543 ub = (k+1-x) * a[k+(l+1)*<a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>] + (x-k) * a[k+1+(l+1)*<a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>];
  3633. <a name="l03544"></a>03544 b[i+j*<a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>] = (l+1-y) * ua + (y-l) * ub;
  3634. <a name="l03545"></a>03545 }
  3635. <a name="l03546"></a>03546 <span class="keywordflow">else</span> b[i+j*<a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>] = - 99999.0;
  3636. <a name="l03547"></a>03547 }
  3637. <a name="l03548"></a>03548 }
  3638. <a name="l03549"></a>03549
  3639. <a name="l03550"></a>03550
  3640. <a name="l03551"></a>03551 <span class="comment">/* ======================================================= */</span>
  3641. <a name="l03552"></a>03552 <span class="comment">/* lp2az - transform lon/lat array to azimuthal projection */</span>
  3642. <a name="l03553"></a>03553 <span class="comment">/* ======================================================= */</span>
  3643. <a name="l03554"></a>03554
  3644. <a name="l03555"></a><a class="code" href="pumax_8c.html#a1f2dead227675ed5a1344d3b1ce57fe3">03555</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a1f2dead227675ed5a1344d3b1ce57fe3">lp2az</a>(<a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> *a, <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> *b, <span class="keywordtype">float</span> laz)
  3645. <a name="l03556"></a>03556 {
  3646. <a name="l03557"></a>03557 <span class="keywordtype">int</span> x,y,dxc,k,k1,l;
  3647. <a name="l03558"></a>03558 <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> dx,dy,lam,rho,rad,phi,ua,ub,l00,p00,xpi,ypi;
  3648. <a name="l03559"></a>03559
  3649. <a name="l03560"></a>03560 rad = DimY &gt;&gt; 1;
  3650. <a name="l03561"></a>03561 dxc = DimX &gt;&gt; 1;
  3651. <a name="l03562"></a>03562 xpi = DimX / M_PI * 0.5;
  3652. <a name="l03563"></a>03563 ypi = DimY / M_PI;
  3653. <a name="l03564"></a>03564 l00 = (int)((laz * DimX) / 360 + dxc) % DimX;
  3654. <a name="l03565"></a>03565 p00 = DimY / 2;
  3655. <a name="l03566"></a>03566
  3656. <a name="l03567"></a>03567 <span class="keywordflow">for</span> (y = 0 ; y &lt; <a class="code" href="pumax_8c.html#ace2f02cb6559cc7f528a995935d30878">DimY</a> ; ++y)
  3657. <a name="l03568"></a>03568 {
  3658. <a name="l03569"></a>03569 dy = y - rad;
  3659. <a name="l03570"></a>03570 phi = y;
  3660. <a name="l03571"></a>03571 <span class="keywordflow">for</span> (x = 0 ; x &lt; <a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a> ; ++x)
  3661. <a name="l03572"></a>03572 {
  3662. <a name="l03573"></a>03573 dx = x - dxc;
  3663. <a name="l03574"></a>03574 rho = sqrt(dx * dx + dy * dy);
  3664. <a name="l03575"></a>03575 <span class="keywordflow">if</span> (rho &lt; rad)
  3665. <a name="l03576"></a>03576 {
  3666. <a name="l03577"></a>03577 lam = l00 + xpi * atan2(dx / rad, cos(asin(rho / rad)));
  3667. <a name="l03578"></a>03578 phi = p00 + ypi * asin(dy / rad);
  3668. <a name="l03579"></a>03579 k = lam;
  3669. <a name="l03580"></a>03580 k1 = k + 1;
  3670. <a name="l03581"></a>03581 <span class="keywordflow">if</span> (k1 &gt;= DimX) k1 = 0;
  3671. <a name="l03582"></a>03582 l = phi;
  3672. <a name="l03583"></a>03583 ua = (k+1-lam) * a[k+ l *DimX] + (lam-k) * a[k1 + l *<a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>];
  3673. <a name="l03584"></a>03584 ub = (k+1-lam) * a[k+(l+1)*<a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>] + (lam-k) * a[k+1+(l+1)*<a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>];
  3674. <a name="l03585"></a>03585 b[x+y*<a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>] = (l+1-y) * ua + (y-l) * ub;
  3675. <a name="l03586"></a>03586 }
  3676. <a name="l03587"></a>03587 <span class="keywordflow">else</span> b[x+y*<a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>] = - 99999.0;
  3677. <a name="l03588"></a>03588 }
  3678. <a name="l03589"></a>03589 }
  3679. <a name="l03590"></a>03590 }
  3680. <a name="l03591"></a>03591
  3681. <a name="l03592"></a><a class="code" href="pumax_8c.html#a76fadfb9ad5d4b5629b491009adc18ee">03592</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a76fadfb9ad5d4b5629b491009adc18ee">ShowGridCS</a>(<span class="keywordtype">void</span>)
  3682. <a name="l03593"></a>03593 {
  3683. <a name="l03594"></a>03594 <span class="keywordtype">int</span> jlev,jlat,x,y,len;
  3684. <a name="l03595"></a>03595 <span class="keywordtype">float</span> dx,dy;
  3685. <a name="l03596"></a>03596 <span class="keywordtype">char</span> Text[80];
  3686. <a name="l03597"></a>03597
  3687. <a name="l03598"></a>03598 <span class="comment">/* Grid for zonal mean cross sections */</span>
  3688. <a name="l03599"></a>03599
  3689. <a name="l03600"></a>03600 XSetForeground(display,gc,WhitePix);
  3690. <a name="l03601"></a>03601 XSetBackground(display,gc,BlackPix);
  3691. <a name="l03602"></a>03602 XSetLineAttributes(display,gc,1,LineOnOffDash,CapButt,JoinRound);
  3692. <a name="l03603"></a>03603 dy = (InYSize - <a class="code" href="pumax_8c.html#a10481cd98c85988914fe8442f4ba3d83">OffY</a>) / (DimY - 1.0);
  3693. <a name="l03604"></a>03604 <span class="keywordflow">for</span> (jlev = 1 ; jlev &lt; DimY-1 ; ++jlev)
  3694. <a name="l03605"></a>03605 {
  3695. <a name="l03606"></a>03606 y = OffY + jlev * dy;
  3696. <a name="l03607"></a>03607 XDrawLine(display,pix,gc,OffX,y,InXSize-1,y);
  3697. <a name="l03608"></a>03608 }
  3698. <a name="l03609"></a>03609 dx = (InXSize - <a class="code" href="pumax_8c.html#a67c8f2f939a4939efcfc51b1a2edff05">OffX</a>) / 6.0; <span class="comment">/* Every 30 degrees */</span>
  3699. <a name="l03610"></a>03610 <span class="keywordflow">for</span> (jlat = 1 ; jlat &lt; 6 ; ++jlat)
  3700. <a name="l03611"></a>03611 {
  3701. <a name="l03612"></a>03612 x = OffX + jlat * dx;
  3702. <a name="l03613"></a>03613 XDrawLine(display,pix,gc,x,OffY,x,InYSize-1);
  3703. <a name="l03614"></a>03614 }
  3704. <a name="l03615"></a>03615 <span class="keywordflow">if</span> (GridLabel)
  3705. <a name="l03616"></a>03616 {
  3706. <a name="l03617"></a>03617 XDrawImageString(display,pix,gc,InXSize/2-FixFontWidth,InYSize-FixFont-&gt;descent,<span class="stringliteral">&quot;EQ&quot;</span>,2);
  3707. <a name="l03618"></a>03618 XDrawImageString(display,pix,gc,OffX,InYSize-FixFont-&gt;descent,<span class="stringliteral">&quot;N&quot;</span>,1);
  3708. <a name="l03619"></a>03619 XDrawImageString(display,pix,gc,InXSize-FixFontWidth,InYSize-FixFont-&gt;descent,<span class="stringliteral">&quot;S&quot;</span>,1);
  3709. <a name="l03620"></a>03620 }
  3710. <a name="l03621"></a>03621 XSetLineAttributes(display,gc,1,LineSolid,CapButt,JoinRound);
  3711. <a name="l03622"></a>03622 }
  3712. <a name="l03623"></a>03623
  3713. <a name="l03624"></a><a class="code" href="pumax_8c.html#a1605a005c902c708301c522cb78ed5d9">03624</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a1605a005c902c708301c522cb78ed5d9">ShowGridCol</a>(<span class="keywordtype">void</span>)
  3714. <a name="l03625"></a>03625 {
  3715. <a name="l03626"></a>03626 <span class="keywordtype">int</span> jlev,jtim,x,y,len;
  3716. <a name="l03627"></a>03627 <span class="keywordtype">float</span> dx,dy;
  3717. <a name="l03628"></a>03628 <span class="keywordtype">char</span> Text[80];
  3718. <a name="l03629"></a>03629
  3719. <a name="l03630"></a>03630 <span class="comment">/* Grid for column time series */</span>
  3720. <a name="l03631"></a>03631
  3721. <a name="l03632"></a>03632 XSetForeground(display,gc,WhitePix);
  3722. <a name="l03633"></a>03633 XSetBackground(display,gc,BlackPix);
  3723. <a name="l03634"></a>03634 XSetLineAttributes(display,gc,1,LineOnOffDash,CapButt,JoinRound);
  3724. <a name="l03635"></a>03635 dy = (InYSize - <a class="code" href="pumax_8c.html#a10481cd98c85988914fe8442f4ba3d83">OffY</a>) / (DimY - 1.0);
  3725. <a name="l03636"></a>03636 <span class="keywordflow">for</span> (jlev = 1 ; jlev &lt; DimY-1 ; ++jlev)
  3726. <a name="l03637"></a>03637 {
  3727. <a name="l03638"></a>03638 y = OffY + jlev * dy;
  3728. <a name="l03639"></a>03639 XDrawLine(display,pix,gc,OffX,y,InXSize-1,y);
  3729. <a name="l03640"></a>03640 }
  3730. <a name="l03641"></a>03641 dx = (InXSize - <a class="code" href="pumax_8c.html#a67c8f2f939a4939efcfc51b1a2edff05">OffX</a>) / 4.0; <span class="comment">/* 4 slices */</span>
  3731. <a name="l03642"></a>03642 <span class="keywordflow">for</span> (jtim = 1 ; jtim &lt; 4 ; ++jtim)
  3732. <a name="l03643"></a>03643 {
  3733. <a name="l03644"></a>03644 x = OffX + jtim * dx;
  3734. <a name="l03645"></a>03645 XDrawLine(display,pix,gc,x,OffY,x,InYSize-1);
  3735. <a name="l03646"></a>03646 }
  3736. <a name="l03647"></a>03647 <span class="keywordflow">if</span> (GridLabel)
  3737. <a name="l03648"></a>03648 {
  3738. <a name="l03649"></a>03649 XDrawImageString(display,pix,gc,InXSize/2-3*FixFontWidth/2,InYSize-FixFont-&gt;descent,<span class="stringliteral">&quot;t-2&quot;</span>,3);
  3739. <a name="l03650"></a>03650 XDrawImageString(display,pix,gc,InXSize/4-3*FixFontWidth/2,InYSize-FixFont-&gt;descent,<span class="stringliteral">&quot;t-3&quot;</span>,3);
  3740. <a name="l03651"></a>03651 XDrawImageString(display,pix,gc,3*InXSize/4-3*FixFontWidth/2,InYSize-FixFont-&gt;descent,<span class="stringliteral">&quot;t-1&quot;</span>,3);
  3741. <a name="l03652"></a>03652 }
  3742. <a name="l03653"></a>03653 XSetLineAttributes(display,gc,1,LineSolid,CapButt,JoinRound);
  3743. <a name="l03654"></a>03654 }
  3744. <a name="l03655"></a>03655
  3745. <a name="l03656"></a><a class="code" href="pumax_8c.html#a48f79382d1404129c81412462243a5bd">03656</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a48f79382d1404129c81412462243a5bd">ShowGridLonsi</a>(<span class="keywordtype">void</span>)
  3746. <a name="l03657"></a>03657 {
  3747. <a name="l03658"></a>03658 <span class="keywordtype">int</span> jlev,jlat,x,y,len;
  3748. <a name="l03659"></a>03659 <span class="keywordtype">float</span> dx,dy;
  3749. <a name="l03660"></a>03660 <span class="keywordtype">char</span> Text[80];
  3750. <a name="l03661"></a>03661
  3751. <a name="l03662"></a>03662 <span class="comment">/* Grid for Longitude Sigma section */</span>
  3752. <a name="l03663"></a>03663
  3753. <a name="l03664"></a>03664 XSetForeground(display,gc,WhitePix);
  3754. <a name="l03665"></a>03665 XSetBackground(display,gc,BlackPix);
  3755. <a name="l03666"></a>03666 XSetLineAttributes(display,gc,1,LineOnOffDash,CapButt,JoinRound);
  3756. <a name="l03667"></a>03667 dy = (InYSize - <a class="code" href="pumax_8c.html#a10481cd98c85988914fe8442f4ba3d83">OffY</a>) / (DimY - 1.0);
  3757. <a name="l03668"></a>03668 <span class="keywordflow">for</span> (jlev = 1 ; jlev &lt; DimY-1 ; ++jlev)
  3758. <a name="l03669"></a>03669 {
  3759. <a name="l03670"></a>03670 y = OffY + jlev * dy;
  3760. <a name="l03671"></a>03671 XDrawLine(display,pix,gc,OffX,y,InXSize-1,y);
  3761. <a name="l03672"></a>03672 }
  3762. <a name="l03673"></a>03673 dx = (InXSize - <a class="code" href="pumax_8c.html#a67c8f2f939a4939efcfc51b1a2edff05">OffX</a>) / 6.0; <span class="comment">/* Every 60 degrees */</span>
  3763. <a name="l03674"></a>03674 <span class="keywordflow">for</span> (jlat = 1 ; jlat &lt; 6 ; ++jlat)
  3764. <a name="l03675"></a>03675 {
  3765. <a name="l03676"></a>03676 x = OffX + jlat * dx;
  3766. <a name="l03677"></a>03677 XDrawLine(display,pix,gc,x,OffY,x,InYSize-1);
  3767. <a name="l03678"></a>03678 }
  3768. <a name="l03679"></a>03679 <span class="keywordflow">if</span> (GridLabel)
  3769. <a name="l03680"></a>03680 {
  3770. <a name="l03681"></a>03681 XDrawImageString(display,pix,gc,InXSize/2-3*FixFontWidth/2,InYSize-FixFont-&gt;descent,<span class="stringliteral">&quot;180&quot;</span>,3);
  3771. <a name="l03682"></a>03682 XDrawImageString(display,pix,gc,OffX,InYSize-FixFont-&gt;descent,<span class="stringliteral">&quot;0&quot;</span>,1);
  3772. <a name="l03683"></a>03683 XDrawImageString(display,pix,gc,InXSize-3*FixFontWidth,InYSize-FixFont-&gt;descent,<span class="stringliteral">&quot;360&quot;</span>,3);
  3773. <a name="l03684"></a>03684 }
  3774. <a name="l03685"></a>03685 XSetLineAttributes(display,gc,1,LineSolid,CapButt,JoinRound);
  3775. <a name="l03686"></a>03686 }
  3776. <a name="l03687"></a>03687
  3777. <a name="l03688"></a><a class="code" href="pumax_8c.html#a3c6f5ed7ed2b12beb152524aef7c8670">03688</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a3c6f5ed7ed2b12beb152524aef7c8670">ShowGridCyl</a>(<span class="keywordtype">void</span>)
  3778. <a name="l03689"></a>03689 {
  3779. <a name="l03690"></a>03690 <span class="keywordtype">int</span> jlon,jlat,x,y;
  3780. <a name="l03691"></a>03691 <span class="keywordtype">float</span> dx,dy;
  3781. <a name="l03692"></a>03692
  3782. <a name="l03693"></a>03693 <span class="comment">/* Grid for cylinder projection */</span>
  3783. <a name="l03694"></a>03694
  3784. <a name="l03695"></a>03695 XSetForeground(display,gc,WhitePix);
  3785. <a name="l03696"></a>03696 XSetBackground(display,gc,BlackPix);
  3786. <a name="l03697"></a>03697 XSetLineAttributes(display,gc,1,LineOnOffDash,CapButt,JoinRound);
  3787. <a name="l03698"></a>03698 dy = (InYSize - <a class="code" href="pumax_8c.html#a10481cd98c85988914fe8442f4ba3d83">OffY</a>) / 6.0;
  3788. <a name="l03699"></a>03699 <span class="keywordflow">for</span> (jlat = 1 ; jlat &lt; 6 ; ++jlat)
  3789. <a name="l03700"></a>03700 {
  3790. <a name="l03701"></a>03701 y = OffY + jlat * dy;
  3791. <a name="l03702"></a>03702 XDrawLine(display,pix,gc,OffX,y,InXSize-1,y);
  3792. <a name="l03703"></a>03703 }
  3793. <a name="l03704"></a>03704 dx = (InXSize - <a class="code" href="pumax_8c.html#a67c8f2f939a4939efcfc51b1a2edff05">OffX</a>) / 6.0; <span class="comment">/* Every 30 degrees */</span>
  3794. <a name="l03705"></a>03705 <span class="keywordflow">for</span> (jlon = 1 ; jlon &lt; 6 ; ++jlon)
  3795. <a name="l03706"></a>03706 {
  3796. <a name="l03707"></a>03707 x = OffX + jlon * dx;
  3797. <a name="l03708"></a>03708 XDrawLine(display,pix,gc,x,OffY,x,InYSize-1);
  3798. <a name="l03709"></a>03709 }
  3799. <a name="l03710"></a>03710 <span class="keywordflow">if</span> (GridLabel)
  3800. <a name="l03711"></a>03711 {
  3801. <a name="l03712"></a>03712 XDrawImageString(display,pix,gc,OffX,OffY+(InYSize-OffY)/2+FixFontHeight/2-FixFont-&gt;descent,<span class="stringliteral">&quot;EQ&quot;</span>,2);
  3802. <a name="l03713"></a>03713 XDrawImageString(display,pix,gc,OffX,OffY+FixFontHeight-FixFont-&gt;descent,<span class="stringliteral">&quot;N&quot;</span>,1);
  3803. <a name="l03714"></a>03714 XDrawImageString(display,pix,gc,OffX,InYSize-FixFont-&gt;descent,<span class="stringliteral">&quot;-180&quot;</span>,4);
  3804. <a name="l03715"></a>03715 XDrawImageString(display,pix,gc,InXSize-3*FixFontWidth,InYSize-FixFont-&gt;descent,<span class="stringliteral">&quot;180&quot;</span>,3);
  3805. <a name="l03716"></a>03716 XDrawImageString(display,pix,gc,OffX+(InXSize-OffX)/2-3*FixFontWidth/2,InYSize-FixFont-&gt;descent,<span class="stringliteral">&quot;0&quot;</span>,1);
  3806. <a name="l03717"></a>03717 }
  3807. <a name="l03718"></a>03718 XSetLineAttributes(display,gc,1,LineSolid,CapButt,JoinRound);
  3808. <a name="l03719"></a>03719 }
  3809. <a name="l03720"></a>03720
  3810. <a name="l03721"></a><a class="code" href="pumax_8c.html#a5a4a6887dea464a44006a936603a6a91">03721</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a5a4a6887dea464a44006a936603a6a91">ShowGridHov</a>(<span class="keywordtype">void</span>)
  3811. <a name="l03722"></a>03722 {
  3812. <a name="l03723"></a>03723 <span class="keywordtype">int</span> jlon,jlat,x,y,len;
  3813. <a name="l03724"></a>03724 <span class="keywordtype">float</span> dx,dy;
  3814. <a name="l03725"></a>03725 <span class="keywordtype">char</span> Text[80];
  3815. <a name="l03726"></a>03726
  3816. <a name="l03727"></a>03727 <span class="comment">/* Grid for Hovmoeller */</span>
  3817. <a name="l03728"></a>03728
  3818. <a name="l03729"></a>03729 XSetForeground(display,gc,WhitePix);
  3819. <a name="l03730"></a>03730 XSetBackground(display,gc,BlackPix);
  3820. <a name="l03731"></a>03731 XSetLineAttributes(display,gc,1,LineOnOffDash,CapButt,JoinRound);
  3821. <a name="l03732"></a>03732 dx = (InXSize - <a class="code" href="pumax_8c.html#a67c8f2f939a4939efcfc51b1a2edff05">OffX</a>) / 6.0;
  3822. <a name="l03733"></a>03733 <span class="keywordflow">for</span> (jlon = 1 ; jlon &lt; 6 ; ++jlon)
  3823. <a name="l03734"></a>03734 {
  3824. <a name="l03735"></a>03735 x = OffX + jlon * dx;
  3825. <a name="l03736"></a>03736 XDrawLine(display,pix,gc,x,OffY,x,InYSize-1);
  3826. <a name="l03737"></a>03737 }
  3827. <a name="l03738"></a>03738 dy = (InYSize - <a class="code" href="pumax_8c.html#a10481cd98c85988914fe8442f4ba3d83">OffY</a>) / 5.0; <span class="comment">/* Every 5 days */</span>
  3828. <a name="l03739"></a>03739 <span class="keywordflow">for</span> (jlat = 1 ; jlat &lt; 5 ; ++jlat)
  3829. <a name="l03740"></a>03740 {
  3830. <a name="l03741"></a>03741 y = OffY + jlat * dy;
  3831. <a name="l03742"></a>03742 XDrawLine(display,pix,gc,OffX,y,InXSize-1,y);
  3832. <a name="l03743"></a>03743 }
  3833. <a name="l03744"></a>03744 <span class="keywordflow">if</span> (GridLabel)
  3834. <a name="l03745"></a>03745 {
  3835. <a name="l03746"></a>03746 XDrawImageString(display,pix,gc,OffX,InYSize-FixFont-&gt;descent,<span class="stringliteral">&quot;0&quot;</span>,1);
  3836. <a name="l03747"></a>03747 XDrawImageString(display,pix,gc,InXSize-3*FixFontWidth,InYSize-FixFont-&gt;descent,<span class="stringliteral">&quot;360&quot;</span>,3);
  3837. <a name="l03748"></a>03748 XDrawImageString(display,pix,gc,OffX+(InXSize-OffX)/2-3*FixFontWidth/2,InYSize-FixFont-&gt;descent,<span class="stringliteral">&quot;180&quot;</span>,3);
  3838. <a name="l03749"></a>03749 XDrawImageString(display,pix,gc,OffX,OffY+FixFontHeight-FixFont-&gt;descent,<span class="stringliteral">&quot;t0&quot;</span>,2);
  3839. <a name="l03750"></a>03750 XDrawImageString(display,pix,gc,OffX,OffY+2*InYSize/5+FixFontHeight/2-FixFont-&gt;descent,<span class="stringliteral">&quot;t-2&quot;</span>,3);
  3840. <a name="l03751"></a>03751 XDrawImageString(display,pix,gc,OffX,OffY+4*InYSize/5+FixFontHeight/2-FixFont-&gt;descent,<span class="stringliteral">&quot;t-4&quot;</span>,3);
  3841. <a name="l03752"></a>03752 }
  3842. <a name="l03753"></a>03753 XSetLineAttributes(display,gc,1,LineSolid,CapButt,JoinRound);
  3843. <a name="l03754"></a>03754 }
  3844. <a name="l03755"></a>03755
  3845. <a name="l03756"></a><a class="code" href="pumax_8c.html#ae9322503c9ee71d24ed929c4433b81f0">03756</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#ae9322503c9ee71d24ed929c4433b81f0">ShowGridHovT</a>(<span class="keywordtype">void</span>)
  3846. <a name="l03757"></a>03757 {
  3847. <a name="l03758"></a>03758 <span class="keywordtype">int</span> jlon,jlat,x,y,len;
  3848. <a name="l03759"></a>03759 <span class="keywordtype">float</span> dx,dy;
  3849. <a name="l03760"></a>03760 <span class="keywordtype">char</span> Text[80];
  3850. <a name="l03761"></a>03761
  3851. <a name="l03762"></a>03762 <span class="comment">/* Grid for Hovmoeller */</span>
  3852. <a name="l03763"></a>03763
  3853. <a name="l03764"></a>03764 XSetForeground(display,gc,WhitePix);
  3854. <a name="l03765"></a>03765 XSetBackground(display,gc,BlackPix);
  3855. <a name="l03766"></a>03766 XSetLineAttributes(display,gc,1,LineOnOffDash,CapButt,JoinRound);
  3856. <a name="l03767"></a>03767 dy = (InYSize - <a class="code" href="pumax_8c.html#a10481cd98c85988914fe8442f4ba3d83">OffY</a>) / 6.0;
  3857. <a name="l03768"></a>03768 <span class="keywordflow">for</span> (jlat = 1 ; jlat &lt; 6 ; ++jlat)
  3858. <a name="l03769"></a>03769 {
  3859. <a name="l03770"></a>03770 y = OffY + jlat * dy;
  3860. <a name="l03771"></a>03771 XDrawLine(display,pix,gc,OffX,y,InXSize-1,y);
  3861. <a name="l03772"></a>03772 }
  3862. <a name="l03773"></a>03773 dx = (InXSize - <a class="code" href="pumax_8c.html#a67c8f2f939a4939efcfc51b1a2edff05">OffX</a>) / 5.0; <span class="comment">/* Every 5 days */</span>
  3863. <a name="l03774"></a>03774 <span class="keywordflow">for</span> (jlat = 1 ; jlat &lt; 5 ; ++jlat)
  3864. <a name="l03775"></a>03775 {
  3865. <a name="l03776"></a>03776 x = OffX + jlat * dx;
  3866. <a name="l03777"></a>03777 XDrawLine(display,pix,gc,x,OffY,x,InYSize-1);
  3867. <a name="l03778"></a>03778 }
  3868. <a name="l03779"></a>03779 <span class="keywordflow">if</span> (GridLabel)
  3869. <a name="l03780"></a>03780 {
  3870. <a name="l03781"></a>03781 XDrawImageString(display,pix,gc,OffX,OffY+FixFontHeight-FixFont-&gt;descent,<span class="stringliteral">&quot;0&quot;</span>,1);
  3871. <a name="l03782"></a>03782 XDrawImageString(display,pix,gc,OffX,OffY+(InYSize-OffY)/2+FixFontHeight/2-FixFont-&gt;descent,<span class="stringliteral">&quot;180&quot;</span>,3);
  3872. <a name="l03783"></a>03783 XDrawImageString(display,pix,gc,OffX,InYSize-FixFont-&gt;descent,<span class="stringliteral">&quot;360&quot;</span>,3);
  3873. <a name="l03784"></a>03784 XDrawImageString(display,pix,gc,InXSize-2*FixFontWidth,InYSize-FixFont-&gt;descent,<span class="stringliteral">&quot;t0&quot;</span>,2);
  3874. <a name="l03785"></a>03785 XDrawImageString(display,pix,gc,3*InXSize/5-3*FixFontWidth/2,InYSize-FixFont-&gt;descent,<span class="stringliteral">&quot;t-2&quot;</span>,3);
  3875. <a name="l03786"></a>03786 XDrawImageString(display,pix,gc, InXSize/5-3*FixFontWidth/2,InYSize-FixFont-&gt;descent,<span class="stringliteral">&quot;t-4&quot;</span>,3);
  3876. <a name="l03787"></a>03787 }
  3877. <a name="l03788"></a>03788 XSetLineAttributes(display,gc,1,LineSolid,CapButt,JoinRound);
  3878. <a name="l03789"></a>03789 }
  3879. <a name="l03790"></a>03790
  3880. <a name="l03791"></a><a class="code" href="pumax_8c.html#a8736525de26ffa57c6d3f302e0464e88">03791</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a8736525de26ffa57c6d3f302e0464e88">ShowGridPolar</a>(<span class="keywordtype">void</span>)
  3881. <a name="l03792"></a>03792 {
  3882. <a name="l03793"></a>03793 <span class="keywordtype">int</span> dx,dy,x,y,xh,yh,ox,oy;
  3883. <a name="l03794"></a>03794 XPoint pxy[3];
  3884. <a name="l03795"></a>03795
  3885. <a name="l03796"></a>03796 <span class="comment">/* Grid for polar projection */</span>
  3886. <a name="l03797"></a>03797
  3887. <a name="l03798"></a>03798 dx = (InXSize - <a class="code" href="pumax_8c.html#a67c8f2f939a4939efcfc51b1a2edff05">OffX</a>) / 2;
  3888. <a name="l03799"></a>03799 dy = (InYSize - <a class="code" href="pumax_8c.html#a10481cd98c85988914fe8442f4ba3d83">OffY</a>);
  3889. <a name="l03800"></a>03800 xh = dx / 2;
  3890. <a name="l03801"></a>03801 yh = dy / 2;
  3891. <a name="l03802"></a>03802 ox = dx / 3.414;
  3892. <a name="l03803"></a>03803 oy = dy / 3.414;
  3893. <a name="l03804"></a>03804
  3894. <a name="l03805"></a>03805 <span class="keywordflow">if</span> (Grid)
  3895. <a name="l03806"></a>03806 {
  3896. <a name="l03807"></a>03807 XSetForeground(display,gc,WhitePix);
  3897. <a name="l03808"></a>03808 XSetBackground(display,gc,BlackPix);
  3898. <a name="l03809"></a>03809 XSetLineAttributes(display,gc,1,LineOnOffDash,CapButt,JoinRound);
  3899. <a name="l03810"></a>03810
  3900. <a name="l03811"></a>03811 <span class="comment">/* Northern Hemisphere */</span>
  3901. <a name="l03812"></a>03812
  3902. <a name="l03813"></a>03813 XDrawArc(display,pix,gc,OffX+dx/6,OffY+dy/6,2*dx/3,2*dy/3,0,360*64);
  3903. <a name="l03814"></a>03814 XDrawArc(display,pix,gc,OffX+dx/3,OffY+dy/3,dx/3,dy/3,0,360*64);
  3904. <a name="l03815"></a>03815
  3905. <a name="l03816"></a>03816 XDrawLine(display,pix,gc,OffX,yh,InXSize,yh);
  3906. <a name="l03817"></a>03817 XDrawLine(display,pix,gc,OffX+xh,OffY,OffX+xh,InYSize);
  3907. <a name="l03818"></a>03818
  3908. <a name="l03819"></a>03819 <span class="comment">/* Southern Hemisphere */</span>
  3909. <a name="l03820"></a>03820
  3910. <a name="l03821"></a>03821 XDrawArc(display,pix,gc,OffX+7*dx/6,OffY+dy/6,2*dx/3,2*dy/3,0,360*64);
  3911. <a name="l03822"></a>03822 XDrawArc(display,pix,gc,OffX+4*dx/3,OffY+dy/3,dx/3,dy/3,0,360*64);
  3912. <a name="l03823"></a>03823
  3913. <a name="l03824"></a>03824 x = OffX + dx + xh;
  3914. <a name="l03825"></a>03825 XDrawLine(display,pix,gc,x,OffY,x,InYSize);
  3915. <a name="l03826"></a>03826
  3916. <a name="l03827"></a>03827 <span class="keywordflow">if</span> (GridLabel)
  3917. <a name="l03828"></a>03828 {
  3918. <a name="l03829"></a>03829 x = OffX + xh - FixFontWidth/2;
  3919. <a name="l03830"></a>03830 y = OffY + yh + FixFontHeight/2 - FixFont-&gt;descent;
  3920. <a name="l03831"></a>03831 XDrawImageString(display,pix,gc,x,y,<span class="stringliteral">&quot;N&quot;</span>,1);
  3921. <a name="l03832"></a>03832 XDrawImageString(display,pix,gc,x+dx,y,<span class="stringliteral">&quot;S&quot;</span>,1);
  3922. <a name="l03833"></a>03833 }
  3923. <a name="l03834"></a>03834 XSetLineAttributes(display,gc,1,LineSolid,CapButt,JoinRound);
  3924. <a name="l03835"></a>03835 }
  3925. <a name="l03836"></a>03836
  3926. <a name="l03837"></a>03837 <span class="comment">/* Octagon mask */</span>
  3927. <a name="l03838"></a>03838
  3928. <a name="l03839"></a>03839 XSetForeground(display,gc,BlackPix);
  3929. <a name="l03840"></a>03840 pxy[0].x = pxy[1].x = <a class="code" href="pumax_8c.html#a67c8f2f939a4939efcfc51b1a2edff05">OffX</a>;
  3930. <a name="l03841"></a>03841 pxy[0].y = pxy[2].y = <a class="code" href="pumax_8c.html#a10481cd98c85988914fe8442f4ba3d83">OffY</a>;
  3931. <a name="l03842"></a>03842 pxy[1].y = OffY + oy;
  3932. <a name="l03843"></a>03843 pxy[2].x = OffX + ox;
  3933. <a name="l03844"></a>03844 XFillPolygon(display,pix,gc,pxy,3,Convex,CoordModeOrigin);
  3934. <a name="l03845"></a>03845 pxy[0].x = OffX + dx - ox;
  3935. <a name="l03846"></a>03846 pxy[1].x = OffX + dx;
  3936. <a name="l03847"></a>03847 pxy[2].x = OffX + dx + ox;
  3937. <a name="l03848"></a>03848 XFillPolygon(display,pix,gc,pxy,3,Convex,CoordModeOrigin);
  3938. <a name="l03849"></a>03849 pxy[0].x = InXSize - ox;
  3939. <a name="l03850"></a>03850 pxy[1].x = <a class="code" href="pumax_8c.html#a77751be4ce780fbc796f89264e0834ed">InXSize</a>;
  3940. <a name="l03851"></a>03851 pxy[2].x = <a class="code" href="pumax_8c.html#a77751be4ce780fbc796f89264e0834ed">InXSize</a>;
  3941. <a name="l03852"></a>03852 XFillPolygon(display,pix,gc,pxy,3,Convex,CoordModeOrigin);
  3942. <a name="l03853"></a>03853
  3943. <a name="l03854"></a>03854 pxy[0].x = pxy[1].x = <a class="code" href="pumax_8c.html#a67c8f2f939a4939efcfc51b1a2edff05">OffX</a>;
  3944. <a name="l03855"></a>03855 pxy[0].y = pxy[2].y = <a class="code" href="pumax_8c.html#a2e0311fae05aa716cc8cd6669af5bf3a">InYSize</a>;
  3945. <a name="l03856"></a>03856 pxy[1].y = InYSize - oy;
  3946. <a name="l03857"></a>03857 pxy[2].x = OffX + ox;
  3947. <a name="l03858"></a>03858 XFillPolygon(display,pix,gc,pxy,3,Convex,CoordModeOrigin);
  3948. <a name="l03859"></a>03859 pxy[0].x = OffX + dx - ox;
  3949. <a name="l03860"></a>03860 pxy[1].x = OffX + dx;
  3950. <a name="l03861"></a>03861 pxy[2].x = OffX + dx + ox;
  3951. <a name="l03862"></a>03862 XFillPolygon(display,pix,gc,pxy,3,Convex,CoordModeOrigin);
  3952. <a name="l03863"></a>03863 pxy[0].x = InXSize - ox;
  3953. <a name="l03864"></a>03864 pxy[1].x = <a class="code" href="pumax_8c.html#a77751be4ce780fbc796f89264e0834ed">InXSize</a>;
  3954. <a name="l03865"></a>03865 pxy[2].x = <a class="code" href="pumax_8c.html#a77751be4ce780fbc796f89264e0834ed">InXSize</a>;
  3955. <a name="l03866"></a>03866 XFillPolygon(display,pix,gc,pxy,3,Convex,CoordModeOrigin);
  3956. <a name="l03867"></a>03867 }
  3957. <a name="l03868"></a>03868
  3958. <a name="l03869"></a>03869
  3959. <a name="l03870"></a><a class="code" href="pumax_8c.html#a2bf6b3944a8626182a54245cb8dcea36">03870</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a2bf6b3944a8626182a54245cb8dcea36">AutoPalette</a>(<span class="keywordtype">int</span> w, <span class="keyword">struct</span> <a class="code" href="struct_color_strip.html">ColorStrip</a> Strip[], <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> f[], <span class="keywordtype">int</span> Dim)
  3960. <a name="l03871"></a>03871 {
  3961. <a name="l03872"></a>03872 <span class="keywordtype">int</span> i,nbands;
  3962. <a name="l03873"></a>03873 <span class="keywordtype">double</span> fmin, fmax, frange, delta, fdelta, xdelta, Lo;
  3963. <a name="l03874"></a>03874
  3964. <a name="l03875"></a>03875 fmin = fmax = f[0];
  3965. <a name="l03876"></a>03876 <span class="keywordflow">for</span> (i=0; i &lt; Dim ; ++i)
  3966. <a name="l03877"></a>03877 {
  3967. <a name="l03878"></a>03878 <span class="keywordflow">if</span> (fmin &gt; f[i]) fmin = f[i];
  3968. <a name="l03879"></a>03879 <span class="keywordflow">if</span> (fmax &lt; f[i]) fmax = f[i];
  3969. <a name="l03880"></a>03880 }
  3970. <a name="l03881"></a>03881 frange = fmax - fmin;
  3971. <a name="l03882"></a>03882 Lo = 0.0;
  3972. <a name="l03883"></a>03883 xdelta = 0.1;
  3973. <a name="l03884"></a>03884 <span class="keywordflow">if</span> (frange &gt; 1.0e-10)
  3974. <a name="l03885"></a>03885 {
  3975. <a name="l03886"></a>03886 delta = frange / <a class="code" href="pumax_8c.html#a7f2aa7d59c57b8054e230e2f72564671">AUTOCOLORS</a>;
  3976. <a name="l03887"></a>03887 <span class="keywordflow">if</span> (delta &gt; AutoDelta[w] / 1.4 &amp;&amp; delta &lt; 1.4 * AutoDelta[w])
  3977. <a name="l03888"></a>03888 {
  3978. <a name="l03889"></a>03889 xdelta = AutoXdelt[w];
  3979. <a name="l03890"></a>03890 delta = AutoDelta[w];
  3980. <a name="l03891"></a>03891 Lo = AutoLo[w];
  3981. <a name="l03892"></a>03892 }
  3982. <a name="l03893"></a>03893 <span class="keywordflow">else</span>
  3983. <a name="l03894"></a>03894 {
  3984. <a name="l03895"></a>03895 fdelta = pow(10.0,rint(log10(delta)));
  3985. <a name="l03896"></a>03896 xdelta = fdelta;
  3986. <a name="l03897"></a>03897 nbands = frange / xdelta;
  3987. <a name="l03898"></a>03898 <span class="keywordflow">if</span> (nbands &lt; <a class="code" href="pumax_8c.html#a7f2aa7d59c57b8054e230e2f72564671">AUTOCOLORS</a> / 2) xdelta = 0.5 * fdelta;
  3988. <a name="l03899"></a>03899 <span class="keywordflow">if</span> (nbands &gt; <a class="code" href="pumax_8c.html#a7f2aa7d59c57b8054e230e2f72564671">AUTOCOLORS</a> ) xdelta = 2.0 * fdelta;
  3989. <a name="l03900"></a>03900 nbands = frange / xdelta;
  3990. <a name="l03901"></a>03901 <span class="keywordflow">if</span> (nbands &gt; <a class="code" href="pumax_8c.html#a7f2aa7d59c57b8054e230e2f72564671">AUTOCOLORS</a> ) xdelta = 5.0 * fdelta;
  3991. <a name="l03902"></a>03902 Lo = xdelta * floor(fmin / xdelta);
  3992. <a name="l03903"></a>03903 AutoDelta[w] = delta;
  3993. <a name="l03904"></a>03904 AutoXdelt[w] = xdelta;
  3994. <a name="l03905"></a>03905 AutoLo[w] = Lo;
  3995. <a name="l03906"></a>03906 <span class="comment">/*</span>
  3996. <a name="l03907"></a>03907 <span class="comment"> if (Debug)</span>
  3997. <a name="l03908"></a>03908 <span class="comment"> {</span>
  3998. <a name="l03909"></a>03909 <span class="comment"> printf(&quot;Autopalette\n&quot;);</span>
  3999. <a name="l03910"></a>03910 <span class="comment"> printf(&quot; Range: %14.6e\n&quot;,frange);</span>
  4000. <a name="l03911"></a>03911 <span class="comment"> printf(&quot; delta: %14.6e\n&quot;,delta);</span>
  4001. <a name="l03912"></a>03912 <span class="comment"> printf(&quot;fdelta: %14.6e\n&quot;,fdelta);</span>
  4002. <a name="l03913"></a>03913 <span class="comment"> printf(&quot;xdelta: %14.6e\n&quot;,xdelta);</span>
  4003. <a name="l03914"></a>03914 <span class="comment"> }</span>
  4004. <a name="l03915"></a>03915 <span class="comment">*/</span>
  4005. <a name="l03916"></a>03916 }
  4006. <a name="l03917"></a>03917 }
  4007. <a name="l03918"></a>03918 Strip[0].<a class="code" href="struct_color_strip.html#a4f6280212828381ae297b3f9565e7ce8">Lo</a> = Lo;
  4008. <a name="l03919"></a>03919 <span class="keywordflow">for</span> (i=0 ; i &lt; <a class="code" href="pumax_8c.html#a7f2aa7d59c57b8054e230e2f72564671">AUTOCOLORS</a> ; ++i)
  4009. <a name="l03920"></a>03920 {
  4010. <a name="l03921"></a>03921 Strip[i+1].<a class="code" href="struct_color_strip.html#a4f6280212828381ae297b3f9565e7ce8">Lo</a> = Strip[i].<a class="code" href="struct_color_strip.html#a6deff3a5a5614df503a3af930233730b">Hi</a> = Strip[i].<a class="code" href="struct_color_strip.html#a4f6280212828381ae297b3f9565e7ce8">Lo</a> + xdelta;
  4011. <a name="l03922"></a>03922 <span class="comment">// if (Debug) printf(&quot;Auto[%2d] = %10.4f - %10.4f\n&quot;,i,Strip[i].Lo,Strip[i].Hi);</span>
  4012. <a name="l03923"></a>03923 }
  4013. <a name="l03924"></a>03924 <span class="keywordflow">return</span>;
  4014. <a name="l03925"></a>03925 }
  4015. <a name="l03926"></a>03926
  4016. <a name="l03927"></a>03927
  4017. <a name="l03928"></a>03928 <span class="comment">// Interface routine to model code in FORTRAN</span>
  4018. <a name="l03929"></a>03929
  4019. <a name="l03930"></a><a class="code" href="pumax_8c.html#a583096811c0b0b458ad353d0e09e75a0">03930</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a583096811c0b0b458ad353d0e09e75a0">guiput_</a>(<span class="keywordtype">char</span> *aname, <span class="keywordtype">float</span> *array, <span class="keywordtype">int</span> *dimx, <span class="keywordtype">int</span> *dimy, <span class="keywordtype">int</span> *dimz)
  4020. <a name="l03931"></a>03931 {
  4021. <a name="l03932"></a>03932 <span class="keywordtype">int</span> i,nb,nf;
  4022. <a name="l03933"></a>03933
  4023. <a name="l03934"></a>03934 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">Debug</a>) printf(<span class="stringliteral">&quot;guiput(%s,%12.4e,%d,%d,%d)\n&quot;</span>,
  4024. <a name="l03935"></a>03935 aname,*array,*dimx,*dimy,*dimz);
  4025. <a name="l03936"></a>03936 nf = (*dimx) * (*dimz);
  4026. <a name="l03937"></a>03937 <span class="keywordflow">if</span> (*dimy &gt; 0) nf *= (*dimy);
  4027. <a name="l03938"></a>03938 <span class="keywordflow">else</span> nf *= 2;
  4028. <a name="l03939"></a>03939 nb = nf * <span class="keyword">sizeof</span>(float);
  4029. <a name="l03940"></a>03940 <span class="keywordflow">for</span> (i=0 ; i &lt; <a class="code" href="pumax_8c.html#a66a0f3add0dee72c7f3811b88249a9b6">NumArrays</a> ; ++i)
  4030. <a name="l03941"></a>03941 <span class="keywordflow">if</span> (!strcmp(aname,<a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[i].Name)) <span class="keywordflow">break</span>;
  4031. <a name="l03942"></a>03942 <span class="keywordflow">if</span> (i == NumArrays)
  4032. <a name="l03943"></a>03943 {
  4033. <a name="l03944"></a>03944 ++<a class="code" href="pumax_8c.html#a66a0f3add0dee72c7f3811b88249a9b6">NumArrays</a>;
  4034. <a name="l03945"></a>03945 strcpy(<a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[i].Name,aname);
  4035. <a name="l03946"></a>03946 <a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[i].<a class="code" href="struct_array_struct.html#a38c55a484b3d01e2ffa11f14de2adfd9">Data</a> = <a class="code" href="pumax_8c.html#a2ec2314ef785dc1cddc562590cd034ad">FloatAlloc</a>(nf,aname);
  4036. <a name="l03947"></a>03947 <a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[i].<a class="code" href="struct_array_struct.html#a51fc8e81440a7098077d179fca8d63b8">DimX</a> = *dimx;
  4037. <a name="l03948"></a>03948 <a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[i].<a class="code" href="struct_array_struct.html#a73fc2a83ee5c78d73b0f4389a0771afb">DimY</a> = *dimy;
  4038. <a name="l03949"></a>03949 <a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[i].<a class="code" href="struct_array_struct.html#a53f6572c6d936b07f27d8d6fb9acb915">DimZ</a> = *dimz;
  4039. <a name="l03950"></a>03950 <span class="keywordflow">if</span> (strcmp(aname,<span class="stringliteral">&quot;GU&quot;</span>) == 0) Uindex = i;
  4040. <a name="l03951"></a>03951 <span class="keywordflow">if</span> (strcmp(aname,<span class="stringliteral">&quot;GV&quot;</span>) == 0) Vindex = i;
  4041. <a name="l03952"></a>03952 }
  4042. <a name="l03953"></a>03953 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[i].Data) memcpy(<a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[i].Data,array,nb);
  4043. <a name="l03954"></a>03954 <a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[i].<a class="code" href="struct_array_struct.html#a00b2e20e7e3b5c5f3cf3e9e6cee16ca3">Flag</a> = 1; <span class="comment">// Data have changed</span>
  4044. <a name="l03955"></a>03955 }
  4045. <a name="l03956"></a>03956
  4046. <a name="l03957"></a>03957
  4047. <a name="l03958"></a><a class="code" href="pumax_8c.html#ac3d880b4fabf53d2752d77f1457ba346">03958</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#ac3d880b4fabf53d2752d77f1457ba346">guisend_</a>(<span class="keywordtype">char</span> *aname, <span class="keywordtype">float</span> *array, <span class="keywordtype">int</span> *dimx, <span class="keywordtype">int</span> *dimy, <span class="keywordtype">int</span> *dimz)
  4048. <a name="l03959"></a>03959 {
  4049. <a name="l03960"></a>03960 <span class="keywordtype">int</span> i,nb,nf;
  4050. <a name="l03961"></a>03961
  4051. <a name="l03962"></a>03962 nf = (*dimx) * (*dimz);
  4052. <a name="l03963"></a>03963 <span class="keywordflow">if</span> (*dimy &gt; 0) nf *= (*dimy);
  4053. <a name="l03964"></a>03964 <span class="keywordflow">else</span> nf *= 2;
  4054. <a name="l03965"></a>03965 nb = nf * <span class="keyword">sizeof</span>(float);
  4055. <a name="l03966"></a>03966 <span class="keywordflow">for</span> (i=0 ; i &lt; <a class="code" href="pumax_8c.html#a66a0f3add0dee72c7f3811b88249a9b6">NumArrays</a> ; ++i)
  4056. <a name="l03967"></a>03967 <span class="keywordflow">if</span> (!strcmp(aname,<a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[i].Name)) <span class="keywordflow">break</span>;
  4057. <a name="l03968"></a>03968 <span class="keywordflow">if</span> (i == NumArrays)
  4058. <a name="l03969"></a>03969 {
  4059. <a name="l03970"></a>03970 ++<a class="code" href="pumax_8c.html#a66a0f3add0dee72c7f3811b88249a9b6">NumArrays</a>;
  4060. <a name="l03971"></a>03971 strcpy(<a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[i].Name,aname);
  4061. <a name="l03972"></a>03972 <a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[i].<a class="code" href="struct_array_struct.html#a51fc8e81440a7098077d179fca8d63b8">DimX</a> = *dimx;
  4062. <a name="l03973"></a>03973 <a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[i].<a class="code" href="struct_array_struct.html#a73fc2a83ee5c78d73b0f4389a0771afb">DimY</a> = *dimy;
  4063. <a name="l03974"></a>03974 <a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[i].<a class="code" href="struct_array_struct.html#a53f6572c6d936b07f27d8d6fb9acb915">DimZ</a> = *dimz;
  4064. <a name="l03975"></a>03975 }
  4065. <a name="l03976"></a>03976 <a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[i].<a class="code" href="struct_array_struct.html#a38c55a484b3d01e2ffa11f14de2adfd9">Data</a> = array;
  4066. <a name="l03977"></a>03977 <a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[i].<a class="code" href="struct_array_struct.html#a00b2e20e7e3b5c5f3cf3e9e6cee16ca3">Flag</a> = 1; <span class="comment">// Data have changed</span>
  4067. <a name="l03978"></a>03978 }
  4068. <a name="l03979"></a>03979
  4069. <a name="l03980"></a>03980
  4070. <a name="l03981"></a>03981 <span class="comment">// Do the plot</span>
  4071. <a name="l03982"></a>03982
  4072. <a name="l03983"></a><a class="code" href="pumax_8c.html#a6d3107848ccc42cc33820aad454e7fcb">03983</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a6d3107848ccc42cc33820aad454e7fcb">iso</a>(<span class="keywordtype">int</span> w,<span class="keywordtype">int</span> PicType,<a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> *field,<span class="keywordtype">int</span> dimx,<span class="keywordtype">int</span> dimy,<span class="keywordtype">int</span> dimz,<span class="keywordtype">int</span> pal)
  4073. <a name="l03984"></a>03984 {
  4074. <a name="l03985"></a>03985 <span class="keywordtype">char</span> Text[128];
  4075. <a name="l03986"></a>03986
  4076. <a name="l03987"></a>03987 <span class="keywordtype">int</span> i,j,k,len,lens,xp,yp,status,x;
  4077. <a name="l03988"></a>03988 <span class="keywordtype">int</span> y,dx,r,width,height;
  4078. <a name="l03989"></a>03989 <a class="code" href="pumax_8c.html#af03d9314df919290b49b331146eab250">INTXU</a> border,depth;
  4079. <a name="l03990"></a>03990 <a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a> f,o,ra,rb;
  4080. <a name="l03991"></a>03991 <span class="keywordtype">int</span> CapLines;
  4081. <a name="l03992"></a>03992 <span class="keywordtype">float</span> *tspt;
  4082. <a name="l03993"></a>03993 XEvent WinEvent;
  4083. <a name="l03994"></a>03994 Window Rootwin,Child;
  4084. <a name="l03995"></a>03995
  4085. <a name="l03996"></a>03996 <span class="comment">// if (Debug) printf(&quot;iso(%d,%s,%12.4e,%d,%d,%d,%d)\n&quot;,w,IsoNames[PicType],*field,dimx,dimy,dimz,pal);</span>
  4086. <a name="l03997"></a>03997 <span class="keywordflow">if</span> (Win[w] == 0) <span class="keywordflow">return</span>;
  4087. <a name="l03998"></a>03998 win = w;
  4088. <a name="l03999"></a>03999 <span class="keywordflow">if</span> (SkipFreq &gt; 1 &amp;&amp; (nstep % SkipFreq) != 0 &amp;&amp;
  4089. <a name="l04000"></a>04000 (PicType == <a class="code" href="pumax_8c.html#afc9e7bd37f3dc38ff12cdf5edb85a6d2">ISOCS</a> || PicType == <a class="code" href="pumax_8c.html#a2f1d89ef346ef5189b556085f4553c4c">ISOHOR</a> || PicType == <a class="code" href="pumax_8c.html#a3e3bcad4c273544328bcdcaef35c3852">MAPHOR</a> || PicType == <a class="code" href="pumax_8c.html#a35e0c3caf44835d5c02d3af3b975e21b">ISOCOL</a>)) <span class="keywordflow">return</span>;
  4090. <a name="l04001"></a>04001 XGetGeometry(display,Win[w],&amp;Rootwin,&amp;xp,&amp;yp,&amp;WinXSize,&amp;WinYSize,
  4091. <a name="l04002"></a>04002 &amp;border,&amp;depth);
  4092. <a name="l04003"></a>04003 <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].<a class="code" href="struct_win_att_struct.html#a6e7f8041c23d41b7d2835a2b855d35f0">w</a> = <a class="code" href="pumax_8c.html#a90fa18336f52663513916236b6c3f633">WinXSize</a>;
  4093. <a name="l04004"></a>04004 <a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].<a class="code" href="struct_win_att_struct.html#aa9c1c94dee4ebbe95eb392f738835055">h</a> = <a class="code" href="pumax_8c.html#a48ba2c20a7bf82da8f16252eff21155f">WinYSize</a>;
  4094. <a name="l04005"></a>04005 InXSize = WinXSize - <a class="code" href="pumax_8c.html#a67c8f2f939a4939efcfc51b1a2edff05">OffX</a>;
  4095. <a name="l04006"></a>04006 InYSize = WinYSize - <a class="code" href="pumax_8c.html#a10481cd98c85988914fe8442f4ba3d83">OffY</a>;
  4096. <a name="l04007"></a>04007 <span class="keywordflow">if</span> (PicType != <a class="code" href="pumax_8c.html#a4c30d0a50533694deda0fcf3551b6935">ISOTRA</a> &amp;&amp; PicType != <a class="code" href="pumax_8c.html#a1572b520f538d357372e96d0185275e5">MAPTRA</a>) InYSize -= 20; <span class="comment">// Room for colorbar</span>
  4097. <a name="l04008"></a>04008 DimX = dimx;
  4098. <a name="l04009"></a>04009 DimY = dimy;
  4099. <a name="l04010"></a>04010 DimZ = dimz;
  4100. <a name="l04011"></a>04011 <span class="keywordflow">if</span> (DimY &lt; 0) DimY = -<a class="code" href="pumax_8c.html#ace2f02cb6559cc7f528a995935d30878">DimY</a>; <span class="comment">// Get NTP1 for ISOSH</span>
  4101. <a name="l04012"></a>04012 DimXY = DimX * <a class="code" href="pumax_8c.html#ace2f02cb6559cc7f528a995935d30878">DimY</a>;
  4102. <a name="l04013"></a>04013 VGAX = (InXSize-1.0) / (DimX-1.0);
  4103. <a name="l04014"></a>04014 <span class="keywordflow">if</span> (DimY &gt; 1) VGAY = (InYSize-1.0) / (DimY-1.0);
  4104. <a name="l04015"></a>04015 <span class="keywordflow">else</span> VGAY = 1.0;
  4105. <a name="l04016"></a>04016 Field = field;
  4106. <a name="l04017"></a>04017
  4107. <a name="l04018"></a>04018 <span class="keywordflow">if</span> (PicType == <a class="code" href="pumax_8c.html#a4c30d0a50533694deda0fcf3551b6935">ISOTRA</a> || PicType == <a class="code" href="pumax_8c.html#a1572b520f538d357372e96d0185275e5">MAPTRA</a>)
  4108. <a name="l04019"></a>04019 {
  4109. <a name="l04020"></a>04020 DimX = dimx; <span class="comment">// NLON</span>
  4110. <a name="l04021"></a>04021 DimY = dimy; <span class="comment">// NLAT</span>
  4111. <a name="l04022"></a>04022 DimZ = dimz; <span class="comment">// NLEV</span>
  4112. <a name="l04023"></a>04023 DimXY = DimX * <a class="code" href="pumax_8c.html#ace2f02cb6559cc7f528a995935d30878">DimY</a>;
  4113. <a name="l04024"></a>04024 VGAX = (InXSize-1.0) / (DimX-1.0);
  4114. <a name="l04025"></a>04025 VGAY = (InYSize-1.0) / (DimY-1.0);
  4115. <a name="l04026"></a>04026 <span class="keywordflow">if</span> (MaxZ[w] &lt; DimZ)
  4116. <a name="l04027"></a>04027 {
  4117. <a name="l04028"></a>04028 MaxZ[w] = <a class="code" href="pumax_8c.html#a510628f6a0e0c51b4ca6492e4d8595e0">DimZ</a>;
  4118. <a name="l04029"></a>04029 Indez[w] = DimZ / 4;
  4119. <a name="l04030"></a>04030 <a class="code" href="pumax_8c.html#ac78f1f279638bfd177687a680c4c21ce">SwitchIndez</a>(w,0); <span class="comment">// Initialize title</span>
  4120. <a name="l04031"></a>04031 }
  4121. <a name="l04032"></a>04032 }
  4122. <a name="l04033"></a>04033
  4123. <a name="l04034"></a>04034 <span class="keywordflow">if</span> (PicType == <a class="code" href="pumax_8c.html#a2f1d89ef346ef5189b556085f4553c4c">ISOHOR</a> || PicType == <a class="code" href="pumax_8c.html#a3e3bcad4c273544328bcdcaef35c3852">MAPHOR</a>)
  4124. <a name="l04035"></a>04035 {
  4125. <a name="l04036"></a>04036 DimX = dimx; <span class="comment">// NLON</span>
  4126. <a name="l04037"></a>04037 DimY = dimy; <span class="comment">// NLAT</span>
  4127. <a name="l04038"></a>04038 DimZ = dimz; <span class="comment">// NLEV</span>
  4128. <a name="l04039"></a>04039 DimXY = DimX * <a class="code" href="pumax_8c.html#ace2f02cb6559cc7f528a995935d30878">DimY</a>;
  4129. <a name="l04040"></a>04040 VGAX = (InXSize-1.0) / (DimX-1.0);
  4130. <a name="l04041"></a>04041 VGAY = (InYSize-1.0) / (DimY-1.0);
  4131. <a name="l04042"></a>04042 <span class="keywordflow">if</span> (MaxZ[w] &lt; DimZ)
  4132. <a name="l04043"></a>04043 {
  4133. <a name="l04044"></a>04044 MaxZ[w] = <a class="code" href="pumax_8c.html#a510628f6a0e0c51b4ca6492e4d8595e0">DimZ</a>;
  4134. <a name="l04045"></a>04045 Indez[w] = DimZ / 4;
  4135. <a name="l04046"></a>04046 <a class="code" href="pumax_8c.html#ac78f1f279638bfd177687a680c4c21ce">SwitchIndez</a>(w,0); <span class="comment">// Initialize title</span>
  4136. <a name="l04047"></a>04047 TSdata[w] = <a class="code" href="pumax_8c.html#a2ec2314ef785dc1cddc562590cd034ad">FloatAlloc</a>(DimXY,<span class="stringliteral">&quot;ISOLON&quot;</span>);
  4137. <a name="l04048"></a>04048 }
  4138. <a name="l04049"></a>04049 <span class="keywordflow">if</span> (MapPro[w] == <a class="code" href="pumax_8c.html#ad431eb8cf00095009fcd1924efffa213">POLAR</a>)
  4139. <a name="l04050"></a>04050 {
  4140. <a name="l04051"></a>04051 Field = TSdata[w];
  4141. <a name="l04052"></a>04052 <a class="code" href="pumax_8c.html#a47d2c6cfb8dd4bebb935c05cb54c9148">lp2ps</a>(field + Indez[w] * DimXY,Field);
  4142. <a name="l04053"></a>04053 }
  4143. <a name="l04054"></a>04054 <span class="comment">/*</span>
  4144. <a name="l04055"></a>04055 <span class="comment"> else if (MapPro[w] == AZIMUTHAL)</span>
  4145. <a name="l04056"></a>04056 <span class="comment"> {</span>
  4146. <a name="l04057"></a>04057 <span class="comment"> Field = TSdata[w];</span>
  4147. <a name="l04058"></a>04058 <span class="comment"> lp2az(field + Indez[w] * DimXY,Field,MapLR[w].l);</span>
  4148. <a name="l04059"></a>04059 <span class="comment"> }</span>
  4149. <a name="l04060"></a>04060 <span class="comment">*/</span>
  4150. <a name="l04061"></a>04061 <span class="keywordflow">else</span> Field = field + Indez[w] * <a class="code" href="pumax_8c.html#a132288db6a5e56bd89aedf01da72b83f">DimXY</a>;
  4151. <a name="l04062"></a>04062 }
  4152. <a name="l04063"></a>04063
  4153. <a name="l04064"></a>04064 <span class="keywordflow">if</span> (PicType == <a class="code" href="pumax_8c.html#ad3652a10b82037800a3efb555fb7833c">ISOLON</a>)
  4154. <a name="l04065"></a>04065 {
  4155. <a name="l04066"></a>04066 DimX = dimx; <span class="comment">// NLON</span>
  4156. <a name="l04067"></a>04067 DimY = dimz; <span class="comment">// NLEV</span>
  4157. <a name="l04068"></a>04068 DimZ = dimy; <span class="comment">// NLAT</span>
  4158. <a name="l04069"></a>04069 DimXY = DimX * <a class="code" href="pumax_8c.html#ace2f02cb6559cc7f528a995935d30878">DimY</a>;
  4159. <a name="l04070"></a>04070 VGAX = (InXSize-1.0) / (DimX-1.0);
  4160. <a name="l04071"></a>04071 VGAY = (InYSize-1.0) / (DimY-1.0);
  4161. <a name="l04072"></a>04072 <span class="keywordflow">if</span> (!TSdata[w])
  4162. <a name="l04073"></a>04073 {
  4163. <a name="l04074"></a>04074 TSdata[w] = <a class="code" href="pumax_8c.html#a2ec2314ef785dc1cddc562590cd034ad">FloatAlloc</a>(DimXY,<span class="stringliteral">&quot;ISOLON&quot;</span>);
  4164. <a name="l04075"></a>04075 MaxZ[w] = <a class="code" href="pumax_8c.html#a510628f6a0e0c51b4ca6492e4d8595e0">DimZ</a>;
  4165. <a name="l04076"></a>04076 Indez[w] = DimZ / 4;
  4166. <a name="l04077"></a>04077 <a class="code" href="pumax_8c.html#ac78f1f279638bfd177687a680c4c21ce">SwitchIndez</a>(w,0); <span class="comment">// Initialize title</span>
  4167. <a name="l04078"></a>04078 }
  4168. <a name="l04079"></a>04079 Field = TSdata[w];
  4169. <a name="l04080"></a>04080 <span class="keywordflow">for</span> (j=0,i=0,k=DimX*Indez[w] ; j &lt; <a class="code" href="pumax_8c.html#ace2f02cb6559cc7f528a995935d30878">DimY</a> ; ++j,i+=<a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>,k+=DimX*<a class="code" href="pumax_8c.html#a510628f6a0e0c51b4ca6492e4d8595e0">DimZ</a>)
  4170. <a name="l04081"></a>04081 {
  4171. <a name="l04082"></a>04082 memcpy(Field+i,field+k,DimX * <span class="keyword">sizeof</span>(<a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a>)); <span class="comment">// copy latitude</span>
  4172. <a name="l04083"></a>04083 }
  4173. <a name="l04084"></a>04084 }
  4174. <a name="l04085"></a>04085
  4175. <a name="l04086"></a>04086 <span class="keywordflow">if</span> (PicType == <a class="code" href="pumax_8c.html#a5cacfe29b73c60abfa48f1ab23b8d631">ISOHOV</a>)
  4176. <a name="l04087"></a>04087 {
  4177. <a name="l04088"></a>04088 DimX = dimx; <span class="comment">// NLON</span>
  4178. <a name="l04089"></a>04089 DimY = <a class="code" href="pumax_8c.html#ad690a03cd8fa2b253d17c3b93e6ad279">DimT</a>; <span class="comment">// time</span>
  4179. <a name="l04090"></a>04090 DimZ = dimy; <span class="comment">// NLAT</span>
  4180. <a name="l04091"></a>04091 DimXY = DimX * <a class="code" href="pumax_8c.html#ace2f02cb6559cc7f528a995935d30878">DimY</a>;
  4181. <a name="l04092"></a>04092 VGAX = (InXSize-1.0) / (DimX-1.0);
  4182. <a name="l04093"></a>04093 VGAY = (InYSize-1.0) / (DimY-1.0);
  4183. <a name="l04094"></a>04094 <span class="keywordflow">if</span> (!TSdata[w])
  4184. <a name="l04095"></a>04095 {
  4185. <a name="l04096"></a>04096 TSdata[w] = <a class="code" href="pumax_8c.html#a2ec2314ef785dc1cddc562590cd034ad">FloatAlloc</a>(DimXY,<span class="stringliteral">&quot;ISOHOV&quot;</span>);
  4186. <a name="l04097"></a>04097 MaxZ[w] = <a class="code" href="pumax_8c.html#a510628f6a0e0c51b4ca6492e4d8595e0">DimZ</a>;
  4187. <a name="l04098"></a>04098 Indez[w] = DimZ / 4;
  4188. <a name="l04099"></a>04099 <a class="code" href="pumax_8c.html#ac78f1f279638bfd177687a680c4c21ce">SwitchIndez</a>(w,0); <span class="comment">// Initialize title</span>
  4189. <a name="l04100"></a>04100 }
  4190. <a name="l04101"></a>04101 Field = TSdata[w];
  4191. <a name="l04102"></a>04102 memmove(Field+DimX,Field,(DimXY-DimX) * <span class="keyword">sizeof</span>(<a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a>)); <span class="comment">// scroll array</span>
  4192. <a name="l04103"></a>04103 memcpy(Field,field+Indez[w]*DimX,DimX * <span class="keyword">sizeof</span>(<a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a>)); <span class="comment">// add line</span>
  4193. <a name="l04104"></a>04104 }
  4194. <a name="l04105"></a>04105
  4195. <a name="l04106"></a>04106 <span class="comment">// Advance write pointer HovInx until end of DimX</span>
  4196. <a name="l04107"></a>04107 <span class="comment">// then scroll array and reset pointer</span>
  4197. <a name="l04108"></a>04108
  4198. <a name="l04109"></a>04109 <span class="keywordflow">if</span> (PicType == <a class="code" href="pumax_8c.html#ad93abacbefeab6ede34e9110ebce9769">ISOTS</a>)
  4199. <a name="l04110"></a>04110 {
  4200. <a name="l04111"></a>04111 DimX = <a class="code" href="pumax_8c.html#ad690a03cd8fa2b253d17c3b93e6ad279">DimT</a>; <span class="comment">// time</span>
  4201. <a name="l04112"></a>04112 DimY = dimx; <span class="comment">// # of variables</span>
  4202. <a name="l04113"></a>04113 DimZ = dimz;
  4203. <a name="l04114"></a>04114 DimXY = DimX * <a class="code" href="pumax_8c.html#ace2f02cb6559cc7f528a995935d30878">DimY</a>;
  4204. <a name="l04115"></a>04115 VGAX = (InXSize-1.0) / (DimX-1.0);
  4205. <a name="l04116"></a>04116 VGAY = (InYSize-1.0) / (DimY-1.0);
  4206. <a name="l04117"></a>04117 <span class="keywordflow">if</span> (!TSdata[w])
  4207. <a name="l04118"></a>04118 {
  4208. <a name="l04119"></a>04119 TSdata[w] = <a class="code" href="pumax_8c.html#a2ec2314ef785dc1cddc562590cd034ad">FloatAlloc</a>(DimXY+DimX,<span class="stringliteral">&quot;ISOTS&quot;</span>);
  4209. <a name="l04120"></a>04120 }
  4210. <a name="l04121"></a>04121 tspt = TSdata[w];
  4211. <a name="l04122"></a>04122 ++HovInx[w];
  4212. <a name="l04123"></a>04123 <span class="keywordflow">if</span> (HovInx[w] &gt;= DimX)
  4213. <a name="l04124"></a>04124 {
  4214. <a name="l04125"></a>04125 HovInx[w] = 0;
  4215. <a name="l04126"></a>04126 memmove(tspt,tspt+DimX,DimXY * <span class="keyword">sizeof</span>(<a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a>)); <span class="comment">// scroll array</span>
  4216. <a name="l04127"></a>04127 }
  4217. <a name="l04128"></a>04128 <span class="keywordflow">for</span> (i=HovInx[w]+DimX-1,j=0 ; j &lt; <a class="code" href="pumax_8c.html#ace2f02cb6559cc7f528a995935d30878">DimY</a> ; i+=<a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>,++j)
  4218. <a name="l04129"></a>04129 tspt[i] = field[j]; <span class="comment">// add column</span>
  4219. <a name="l04130"></a>04130 Field = tspt+HovInx[w];
  4220. <a name="l04131"></a>04131 }
  4221. <a name="l04132"></a>04132
  4222. <a name="l04133"></a>04133 <span class="keywordflow">if</span> (PicType == <a class="code" href="pumax_8c.html#a35e0c3caf44835d5c02d3af3b975e21b">ISOCOL</a>)
  4223. <a name="l04134"></a>04134 {
  4224. <a name="l04135"></a>04135 DimX = <a class="code" href="pumax_8c.html#ad690a03cd8fa2b253d17c3b93e6ad279">DimT</a>; <span class="comment">// time</span>
  4225. <a name="l04136"></a>04136 DimY = dimx; <span class="comment">// level</span>
  4226. <a name="l04137"></a>04137 DimZ = dimy; <span class="comment">// clickable index</span>
  4227. <a name="l04138"></a>04138 DimXY = DimX * <a class="code" href="pumax_8c.html#ace2f02cb6559cc7f528a995935d30878">DimY</a>;
  4228. <a name="l04139"></a>04139 VGAX = (InXSize-1.0) / (DimX-1.0);
  4229. <a name="l04140"></a>04140 VGAY = (InYSize-1.0) / (DimY-1.0);
  4230. <a name="l04141"></a>04141 <span class="keywordflow">if</span> (!TSdata[w])
  4231. <a name="l04142"></a>04142 {
  4232. <a name="l04143"></a>04143 TSdata[w] = <a class="code" href="pumax_8c.html#a2ec2314ef785dc1cddc562590cd034ad">FloatAlloc</a>(DimXY+DimX,<span class="stringliteral">&quot;ISOCOL&quot;</span>);
  4233. <a name="l04144"></a>04144 MaxZ[w] = <a class="code" href="pumax_8c.html#a510628f6a0e0c51b4ca6492e4d8595e0">DimZ</a>;
  4234. <a name="l04145"></a>04145 Indez[w] = DimZ / 2;
  4235. <a name="l04146"></a>04146 <a class="code" href="pumax_8c.html#ac78f1f279638bfd177687a680c4c21ce">SwitchIndez</a>(w,0); <span class="comment">// Initialize title</span>
  4236. <a name="l04147"></a>04147 }
  4237. <a name="l04148"></a>04148 tspt = TSdata[w];
  4238. <a name="l04149"></a>04149 ++HovInx[w];
  4239. <a name="l04150"></a>04150 <span class="keywordflow">if</span> (HovInx[w] &gt;= DimX)
  4240. <a name="l04151"></a>04151 {
  4241. <a name="l04152"></a>04152 HovInx[w] = 0;
  4242. <a name="l04153"></a>04153 memmove(tspt,tspt+DimX,DimXY * <span class="keyword">sizeof</span>(<a class="code" href="pumax_8c.html#a4b654506f18b8bfd61ad2a29a7e38c25">REAL</a>)); <span class="comment">// scroll array</span>
  4243. <a name="l04154"></a>04154 }
  4244. <a name="l04155"></a>04155 <span class="keywordflow">for</span> (i=HovInx[w]+DimX-1,j=0 ; j &lt; <a class="code" href="pumax_8c.html#ace2f02cb6559cc7f528a995935d30878">DimY</a> ; i+=<a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>,++j)
  4245. <a name="l04156"></a>04156 tspt[i] = field[j+Indez[w]*DimY]; <span class="comment">// add column</span>
  4246. <a name="l04157"></a>04157 Field = tspt+HovInx[w];
  4247. <a name="l04158"></a>04158 }
  4248. <a name="l04159"></a>04159
  4249. <a name="l04160"></a>04160 <span class="keywordflow">if</span> (DimX &gt; FlagSize)
  4250. <a name="l04161"></a>04161 {
  4251. <a name="l04162"></a>04162 <span class="keywordflow">if</span> (Flag) free(Flag);
  4252. <a name="l04163"></a>04163 Flag = <a class="code" href="pumax_8c.html#a97eea41da1321e51271d6dd6c42219cb">IntAlloc</a>(DimX,<span class="stringliteral">&quot;Flag&quot;</span>);
  4253. <a name="l04164"></a>04164 FlagSize = <a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>;
  4254. <a name="l04165"></a>04165 }
  4255. <a name="l04166"></a>04166
  4256. <a name="l04167"></a>04167 <span class="keywordflow">if</span> (PicType == <a class="code" href="pumax_8c.html#ae41274f4b33dfd046884def7709aa887">ISOSH</a>) pal = 1; <span class="comment">// ISOSH has its own palette</span>
  4257. <a name="l04168"></a>04168 <span class="keywordflow">if</span> (pal &lt; 1 || pal &gt;= <a class="code" href="pumax_8c.html#afa68e13002f97f4041b7acca426be273">NUMPAL</a>)
  4258. <a name="l04169"></a>04169 {
  4259. <a name="l04170"></a>04170 Cstrip = <a class="code" href="pumax_8c.html#a0f1e694b411614c27c69b2b2ac6d293d">Autostrip</a>;
  4260. <a name="l04171"></a>04171 <a class="code" href="pumax_8c.html#a2bf6b3944a8626182a54245cb8dcea36">AutoPalette</a>(w,Cstrip,Field,DimXY);
  4261. <a name="l04172"></a>04172 Lines = <a class="code" href="pumax_8c.html#a7f2aa7d59c57b8054e230e2f72564671">AUTOCOLORS</a>;
  4262. <a name="l04173"></a>04173 <span class="comment">// printf(&quot;Autopalette %d for Win %d\n&quot;,pal,w);</span>
  4263. <a name="l04174"></a>04174 }
  4264. <a name="l04175"></a>04175 <span class="keywordflow">else</span>
  4265. <a name="l04176"></a>04176 {
  4266. <a name="l04177"></a>04177 Cstrip = Pallet[<a class="code" href="pumax_8c.html#a90b1e0ef9cf6b06a7711e79eaa1e0618">pal</a>];
  4267. <a name="l04178"></a>04178 Lines = LineCo[<a class="code" href="pumax_8c.html#a90b1e0ef9cf6b06a7711e79eaa1e0618">pal</a>];
  4268. <a name="l04179"></a>04179 }
  4269. <a name="l04180"></a>04180
  4270. <a name="l04181"></a>04181 SizeChanged = (<a class="code" href="pumax_8c.html#a66932718d5aaaf8cd382d6e8e681b96a">WinPixMap</a>[w].<a class="code" href="struct_pix_struct.html#a8cfaa77a4a7e9675273fce59dc437ef4">DimX</a> != WinXSize || <a class="code" href="pumax_8c.html#a66932718d5aaaf8cd382d6e8e681b96a">WinPixMap</a>[w].<a class="code" href="struct_pix_struct.html#a605b726f604da7ec98575dec3da238c8">DimY</a> != <a class="code" href="pumax_8c.html#a48ba2c20a7bf82da8f16252eff21155f">WinYSize</a>);
  4271. <a name="l04182"></a>04182 <span class="keywordflow">if</span> (SizeChanged)
  4272. <a name="l04183"></a>04183 {
  4273. <a name="l04184"></a>04184 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a66932718d5aaaf8cd382d6e8e681b96a">WinPixMap</a>[w].Pix) XFreePixmap(display,<a class="code" href="pumax_8c.html#a66932718d5aaaf8cd382d6e8e681b96a">WinPixMap</a>[w].Pix);
  4274. <a name="l04185"></a>04185 <a class="code" href="pumax_8c.html#a66932718d5aaaf8cd382d6e8e681b96a">WinPixMap</a>[w].<a class="code" href="struct_pix_struct.html#a7e7807591a26e2daa2f16ad2599a2b34">Pix</a> = XCreatePixmap(display,Win[w],WinXSize,WinYSize,ScreenD);
  4275. <a name="l04186"></a>04186 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">Debug</a>)
  4276. <a name="l04187"></a>04187 printf(<span class="stringliteral">&quot;CreatePixmap %10x %6d bytes\n&quot;</span>,
  4277. <a name="l04188"></a>04188 (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>)<a class="code" href="pumax_8c.html#a66932718d5aaaf8cd382d6e8e681b96a">WinPixMap</a>[w].Pix,WinXSize*WinYSize);
  4278. <a name="l04189"></a>04189 <a class="code" href="pumax_8c.html#a66932718d5aaaf8cd382d6e8e681b96a">WinPixMap</a>[w].<a class="code" href="struct_pix_struct.html#a8cfaa77a4a7e9675273fce59dc437ef4">DimX</a> = <a class="code" href="pumax_8c.html#a90fa18336f52663513916236b6c3f633">WinXSize</a>;
  4279. <a name="l04190"></a>04190 <a class="code" href="pumax_8c.html#a66932718d5aaaf8cd382d6e8e681b96a">WinPixMap</a>[w].<a class="code" href="struct_pix_struct.html#a605b726f604da7ec98575dec3da238c8">DimY</a> = <a class="code" href="pumax_8c.html#a48ba2c20a7bf82da8f16252eff21155f">WinYSize</a>;
  4280. <a name="l04191"></a>04191 }
  4281. <a name="l04192"></a>04192 pix = <a class="code" href="pumax_8c.html#a66932718d5aaaf8cd382d6e8e681b96a">WinPixMap</a>[w].<a class="code" href="struct_pix_struct.html#a7e7807591a26e2daa2f16ad2599a2b34">Pix</a>; <span class="comment">/* Set current pixmap */</span>
  4282. <a name="l04193"></a>04193
  4283. <a name="l04194"></a>04194 <span class="comment">/* Draw colour bar */</span>
  4284. <a name="l04195"></a>04195
  4285. <a name="l04196"></a>04196 <span class="keywordflow">if</span> ((SizeChanged || Cstrip == Autostrip) &amp;&amp;
  4286. <a name="l04197"></a>04197 (PicType == <a class="code" href="pumax_8c.html#afc9e7bd37f3dc38ff12cdf5edb85a6d2">ISOCS</a> || PicType == <a class="code" href="pumax_8c.html#a2f1d89ef346ef5189b556085f4553c4c">ISOHOR</a> ||
  4287. <a name="l04198"></a>04198 PicType == <a class="code" href="pumax_8c.html#a5cacfe29b73c60abfa48f1ab23b8d631">ISOHOV</a> || PicType == <a class="code" href="pumax_8c.html#ad3652a10b82037800a3efb555fb7833c">ISOLON</a> ||
  4288. <a name="l04199"></a>04199 PicType == <a class="code" href="pumax_8c.html#a35e0c3caf44835d5c02d3af3b975e21b">ISOCOL</a> || PicType == <a class="code" href="pumax_8c.html#a3e3bcad4c273544328bcdcaef35c3852">MAPHOR</a> ))
  4289. <a name="l04200"></a>04200 {
  4290. <a name="l04201"></a>04201 XSetForeground(display,gc,BlackPix);
  4291. <a name="l04202"></a>04202 XFillRectangle(display,pix,gc,0,InYSize,WinXSize,WinYSize);
  4292. <a name="l04203"></a>04203
  4293. <a name="l04204"></a>04204 CapLines = WinXSize / (20 + 3 * <a class="code" href="pumax_8c.html#ae7e27f08b8bcd6f7cf63edc4b0859d7f">FixFontWidth</a>);
  4294. <a name="l04205"></a>04205 <span class="keywordflow">if</span> (CapLines &gt; Lines) CapLines = <a class="code" href="pumax_8c.html#ab36270a976b49e0122723b7d3bd35b95">Lines</a>;
  4295. <a name="l04206"></a>04206 <span class="keywordflow">for</span> (i=0 ; i &lt; CapLines ; ++i)
  4296. <a name="l04207"></a>04207 {
  4297. <a name="l04208"></a>04208 XSetForeground(display,gc,Cstrip[i].pixel);
  4298. <a name="l04209"></a>04209 XFillRectangle(display,pix,gc,OffX+5+i*(WinXSize-20)/(CapLines-1),
  4299. <a name="l04210"></a>04210 OffY+InYSize+5,10,10);
  4300. <a name="l04211"></a>04211 XSetForeground(display,gc,BlackPix);
  4301. <a name="l04212"></a>04212 XDrawRectangle(display,pix,gc,OffX+5+i*(WinXSize-20)/(CapLines-1),
  4302. <a name="l04213"></a>04213 OffY+InYSize+5,10,10);
  4303. <a name="l04214"></a>04214 }
  4304. <a name="l04215"></a>04215 XSetForeground(display,gc,WhitePix);
  4305. <a name="l04216"></a>04216 XSetBackground(display,gc,BlackPix);
  4306. <a name="l04217"></a>04217 rb = Cstrip[CapLines-2].<a class="code" href="struct_color_strip.html#a6deff3a5a5614df503a3af930233730b">Hi</a> - Cstrip[0].<a class="code" href="struct_color_strip.html#a6deff3a5a5614df503a3af930233730b">Hi</a>;
  4307. <a name="l04218"></a>04218 <span class="keywordflow">for</span> (i=0 ; i &lt; CapLines-1 ; ++i)
  4308. <a name="l04219"></a>04219 {
  4309. <a name="l04220"></a>04220 Text[0] = 0;
  4310. <a name="l04221"></a>04221 ra = Cstrip[i].<a class="code" href="struct_color_strip.html#a6deff3a5a5614df503a3af930233730b">Hi</a>;
  4311. <a name="l04222"></a>04222 j = ra;
  4312. <a name="l04223"></a>04223 <span class="keywordflow">if</span> (j &gt; -1000 &amp;&amp; j &lt; 10000) sprintf(Text,<span class="stringliteral">&quot;%d&quot;</span>,j);
  4313. <a name="l04224"></a>04224 <span class="keywordflow">if</span> (ra &lt; 100.0 &amp;&amp; ra &gt; -9.99)
  4314. <a name="l04225"></a>04225 {
  4315. <a name="l04226"></a>04226 sprintf(Text,<span class="stringliteral">&quot;%4.1f&quot;</span>,ra);
  4316. <a name="l04227"></a>04227 <span class="keywordflow">if</span> (!strcmp(Text+2,<span class="stringliteral">&quot;.0&quot;</span>)) Text[2] = 0;
  4317. <a name="l04228"></a>04228 }
  4318. <a name="l04229"></a>04229 <span class="keywordflow">if</span> (ra &lt; 10.0 &amp;&amp; ra &gt;= 0.0)
  4319. <a name="l04230"></a>04230 {
  4320. <a name="l04231"></a>04231 sprintf(Text,<span class="stringliteral">&quot;%4.2f&quot;</span>,ra);
  4321. <a name="l04232"></a>04232 <span class="keywordflow">if</span> (!strcmp(Text+1,<span class="stringliteral">&quot;.00&quot;</span>)) Text[1] = 0;
  4322. <a name="l04233"></a>04233 }
  4323. <a name="l04234"></a>04234 len = strlen(Text);
  4324. <a name="l04235"></a>04235 <span class="keywordflow">if</span> (len)
  4325. <a name="l04236"></a>04236 {
  4326. <a name="l04237"></a>04237 width = XTextWidth(FixFont,Text,len);
  4327. <a name="l04238"></a>04238 height = FixFont-&gt;ascent + FixFont-&gt;descent;
  4328. <a name="l04239"></a>04239 xp = OffX + 10 + (i+0.5) * (WinXSize-20)/(CapLines-1) - width/2;
  4329. <a name="l04240"></a>04240 yp = WinYSize - height + 10;
  4330. <a name="l04241"></a>04241 XDrawImageString(display,pix,gc,xp,yp,Text,len);
  4331. <a name="l04242"></a>04242 }
  4332. <a name="l04243"></a>04243 }
  4333. <a name="l04244"></a>04244 }
  4334. <a name="l04245"></a>04245
  4335. <a name="l04246"></a>04246 <span class="comment">/* Draw mode legend */</span>
  4336. <a name="l04247"></a>04247
  4337. <a name="l04248"></a>04248 <span class="keywordflow">if</span> (SizeChanged &amp;&amp; PicType == <a class="code" href="pumax_8c.html#ae41274f4b33dfd046884def7709aa887">ISOSH</a>)
  4338. <a name="l04249"></a>04249 {
  4339. <a name="l04250"></a>04250 dx = WinXSize / 23;
  4340. <a name="l04251"></a>04251 XSetForeground(display,gc,BlackPix);
  4341. <a name="l04252"></a>04252 XFillRectangle(display,pix,gc,0,0,WinXSize,WinYSize);
  4342. <a name="l04253"></a>04253
  4343. <a name="l04254"></a>04254 XSetForeground(display,gc,LightGreen.pixel);
  4344. <a name="l04255"></a>04255 XSetBackground(display,gc,BlackPix);
  4345. <a name="l04256"></a>04256 <span class="keywordflow">for</span> (i=0 ; i &lt; 21 ; i+=2)
  4346. <a name="l04257"></a>04257 {
  4347. <a name="l04258"></a>04258 sprintf(Text,<span class="stringliteral">&quot;%d&quot;</span>,i);
  4348. <a name="l04259"></a>04259 len = strlen(Text);
  4349. <a name="l04260"></a>04260 width = XTextWidth(FixFont,Text,len);
  4350. <a name="l04261"></a>04261 height = FixFont-&gt;ascent + FixFont-&gt;descent;
  4351. <a name="l04262"></a>04262 xp = dx + i * dx - width/2 - FixFontWidth/2 + 1;
  4352. <a name="l04263"></a>04263 yp = <a class="code" href="pumax_8c.html#add5a8c33565a2bbcf55996cccc7a434b">FixFontHeight</a>;
  4353. <a name="l04264"></a>04264 XDrawImageString(display,pix,gc,xp,yp,Text,len);
  4354. <a name="l04265"></a>04265 }
  4355. <a name="l04266"></a>04266 XSetForeground(display,gc,LightBlue.pixel);
  4356. <a name="l04267"></a>04267 <span class="keywordflow">for</span> (i=0 ; i &lt; 21 ; i+=2)
  4357. <a name="l04268"></a>04268 {
  4358. <a name="l04269"></a>04269 sprintf(Text,<span class="stringliteral">&quot;%d&quot;</span>,i);
  4359. <a name="l04270"></a>04270 len = strlen(Text);
  4360. <a name="l04271"></a>04271 width = XTextWidth(FixFont,Text,len);
  4361. <a name="l04272"></a>04272 height = FixFont-&gt;ascent + FixFont-&gt;descent;
  4362. <a name="l04273"></a>04273 xp = WinXSize - width - 2;
  4363. <a name="l04274"></a>04274 yp = 2 * FixFontHeight + i * dx;
  4364. <a name="l04275"></a>04275 <span class="keywordflow">if</span> (yp+FixFont-&gt;descent &gt; InYSize) <span class="keywordflow">break</span>;
  4365. <a name="l04276"></a>04276 XDrawImageString(display,pix,gc,xp,yp,Text,len);
  4366. <a name="l04277"></a>04277 }
  4367. <a name="l04278"></a>04278 strcpy(Text,<span class="stringliteral">&quot;n/m&quot;</span>);
  4368. <a name="l04279"></a>04279 len = strlen(Text);
  4369. <a name="l04280"></a>04280 width = XTextWidth(FixFont,Text,len);
  4370. <a name="l04281"></a>04281 xp = WinXSize - width - 2;
  4371. <a name="l04282"></a>04282 yp = <a class="code" href="pumax_8c.html#add5a8c33565a2bbcf55996cccc7a434b">FixFontHeight</a>;
  4372. <a name="l04283"></a>04283 XSetForeground(display,gc,WhitePix);
  4373. <a name="l04284"></a>04284 XDrawImageString(display,pix,gc,xp,yp,Text,len);
  4374. <a name="l04285"></a>04285 strcpy(Text,<span class="stringliteral">&quot;High &quot;</span>);
  4375. <a name="l04286"></a>04286 len = strlen(Text);
  4376. <a name="l04287"></a>04287 width = XTextWidth(FixFont,Text,len);
  4377. <a name="l04288"></a>04288 xp = WinXSize/2 - <a class="code" href="pumax_8c.html#a9923377bd967d1dd49eb98f009f48fc2">AMPLI_COLS</a> * 10 - width;
  4378. <a name="l04289"></a>04289 yp = WinYSize - FixFontHeight + 10;
  4379. <a name="l04290"></a>04290 r = FixFontHeight-2;
  4380. <a name="l04291"></a>04291 XSetForeground(display,gc,WhitePix);
  4381. <a name="l04292"></a>04292 <span class="keywordflow">if</span> (xp &gt; 0) XDrawImageString(display,pix,gc,xp,yp,Text,len);
  4382. <a name="l04293"></a>04293 strcpy(Text,<span class="stringliteral">&quot; Low&quot;</span>);
  4383. <a name="l04294"></a>04294 len = strlen(Text);
  4384. <a name="l04295"></a>04295 width = XTextWidth(FixFont,Text,len);
  4385. <a name="l04296"></a>04296 xp = WinXSize/2 + <a class="code" href="pumax_8c.html#a9923377bd967d1dd49eb98f009f48fc2">AMPLI_COLS</a> * 10;
  4386. <a name="l04297"></a>04297 <span class="keywordflow">if</span> (xp + width &lt; WinXSize) XDrawImageString(display,pix,gc,xp,yp,Text,len);
  4387. <a name="l04298"></a>04298 yp = <a class="code" href="pumax_8c.html#a2e0311fae05aa716cc8cd6669af5bf3a">InYSize</a>;
  4388. <a name="l04299"></a>04299 XDrawLine(display,pix,gc,OffX,yp,WinXSize,yp);
  4389. <a name="l04300"></a>04300 yp = WinYSize - r - FixFont-&gt;descent;
  4390. <a name="l04301"></a>04301
  4391. <a name="l04302"></a>04302 <span class="keywordflow">for</span> (i=0 ; i &lt; <a class="code" href="pumax_8c.html#a9923377bd967d1dd49eb98f009f48fc2">AMPLI_COLS</a> ; ++i)
  4392. <a name="l04303"></a>04303 {
  4393. <a name="l04304"></a>04304 xp = WinXSize/2 - AMPLI_COLS * 10 + i * 20;
  4394. <a name="l04305"></a>04305 XSetForeground(display,gc,AmpliStrip[AMPLI_COLS-i-1].pixel);
  4395. <a name="l04306"></a>04306 XFillArc(display,pix,gc,xp,yp,r,r,0,360*64);
  4396. <a name="l04307"></a>04307 }
  4397. <a name="l04308"></a>04308 }
  4398. <a name="l04309"></a>04309
  4399. <a name="l04310"></a>04310 <span class="keywordflow">if</span> (SizeChanged &amp;&amp; PicType == <a class="code" href="pumax_8c.html#ad93abacbefeab6ede34e9110ebce9769">ISOTS</a>) <span class="comment">/* Timeseries Caption */</span>
  4400. <a name="l04311"></a>04311 {
  4401. <a name="l04312"></a>04312 XSetForeground(display,gc,BlackPix);
  4402. <a name="l04313"></a>04313 XFillRectangle(display,pix,gc,0,InYSize,WinXSize,WinYSize);
  4403. <a name="l04314"></a>04314 XSetBackground(display,gc,BlackPix);
  4404. <a name="l04315"></a>04315
  4405. <a name="l04316"></a>04316 xp = <a class="code" href="pumax_8c.html#ae7e27f08b8bcd6f7cf63edc4b0859d7f">FixFontWidth</a>;
  4406. <a name="l04317"></a>04317 yp = WinYSize - FixFontHeight + 10;
  4407. <a name="l04318"></a>04318 <span class="keywordflow">for</span> (j=0 ; j &lt; <a class="code" href="pumax_8c.html#ace2f02cb6559cc7f528a995935d30878">DimY</a> ; ++j)
  4408. <a name="l04319"></a>04319 {
  4409. <a name="l04320"></a>04320 <span class="keywordflow">if</span> (TSName[j][0])
  4410. <a name="l04321"></a>04321 {
  4411. <a name="l04322"></a>04322 strcpy(Text,TSName[j]);
  4412. <a name="l04323"></a>04323 len = strlen(Text);
  4413. <a name="l04324"></a>04324 width = XTextWidth(FixFont,Text,len);
  4414. <a name="l04325"></a>04325 XSetForeground(display,gc,TSColor[j]);
  4415. <a name="l04326"></a>04326 XDrawImageString(display,pix,gc,xp,yp,Text,len);
  4416. <a name="l04327"></a>04327 xp += width;
  4417. <a name="l04328"></a>04328 }
  4418. <a name="l04329"></a>04329 <span class="keywordflow">if</span> (TSubsc[j][0])
  4419. <a name="l04330"></a>04330 {
  4420. <a name="l04331"></a>04331 XSetFont(display, gc, SubFont-&gt;fid);
  4421. <a name="l04332"></a>04332 strcpy(Text,TSubsc[j]);
  4422. <a name="l04333"></a>04333 len = strlen(Text);
  4423. <a name="l04334"></a>04334 width = XTextWidth(SubFont,Text,len);
  4424. <a name="l04335"></a>04335 XSetForeground(display,gc,TSColor[j]);
  4425. <a name="l04336"></a>04336 XDrawImageString(display,pix,gc,xp,yp,Text,len);
  4426. <a name="l04337"></a>04337 xp += width;
  4427. <a name="l04338"></a>04338 XSetFont(display, gc, FixFont-&gt;fid);
  4428. <a name="l04339"></a>04339 }
  4429. <a name="l04340"></a>04340 xp += <a class="code" href="pumax_8c.html#ae7e27f08b8bcd6f7cf63edc4b0859d7f">FixFontWidth</a>;
  4430. <a name="l04341"></a>04341 }
  4431. <a name="l04342"></a>04342 }
  4432. <a name="l04343"></a>04343
  4433. <a name="l04344"></a>04344 <span class="keywordflow">if</span> (SizeChanged &amp;&amp; PicType == <a class="code" href="pumax_8c.html#aa817497929617f9ee37a0e957c9e21e1">ISOTAB</a>) <span class="comment">/* Table Caption */</span>
  4434. <a name="l04345"></a>04345 {
  4435. <a name="l04346"></a>04346 XSetForeground(display,gc,BlackPix);
  4436. <a name="l04347"></a>04347 XFillRectangle(display,pix,gc,0,0,WinXSize,WinYSize);
  4437. <a name="l04348"></a>04348 XSetBackground(display,gc,BlackPix);
  4438. <a name="l04349"></a>04349 }
  4439. <a name="l04350"></a>04350
  4440. <a name="l04351"></a>04351 <span class="keywordflow">if</span> (PicType == <a class="code" href="pumax_8c.html#ad93abacbefeab6ede34e9110ebce9769">ISOTS</a>)
  4441. <a name="l04352"></a>04352 {
  4442. <a name="l04353"></a>04353 <span class="keywordflow">if</span> (TSxp[w] == NULL) TSxp[w] = <a class="code" href="pumax_8c.html#aa507b1280c95bd8fb1d42c60d91e02ff">SizeAlloc</a>(DimX * DimY , <span class="keyword">sizeof</span>(XPoint),<span class="stringliteral">&quot;TSxp&quot;</span>);
  4443. <a name="l04354"></a>04354 <span class="keywordflow">if</span> (Dmin[w] == NULL) Dmin[w] = <a class="code" href="pumax_8c.html#a2ec2314ef785dc1cddc562590cd034ad">FloatAlloc</a>(DimY ,<span class="stringliteral">&quot;Dmin&quot;</span>);
  4444. <a name="l04355"></a>04355 <span class="keywordflow">if</span> (Dmax[w] == NULL) Dmax[w] = <a class="code" href="pumax_8c.html#a2ec2314ef785dc1cddc562590cd034ad">FloatAlloc</a>(DimY ,<span class="stringliteral">&quot;Dmax&quot;</span>);
  4445. <a name="l04356"></a>04356 XSetForeground(display,gc,BlackPix);
  4446. <a name="l04357"></a>04357 XFillRectangle(display,pix,gc,0,0,WinXSize,InYSize);
  4447. <a name="l04358"></a>04358
  4448. <a name="l04359"></a>04359 <span class="keywordflow">for</span> (j=0 ; j &lt; <a class="code" href="pumax_8c.html#ace2f02cb6559cc7f528a995935d30878">DimY</a> ; ++j) Dmin[w][j] = Dmax[w][j] = field[j];
  4449. <a name="l04360"></a>04360 <span class="keywordflow">if</span> (nstep &gt; 2)
  4450. <a name="l04361"></a>04361 {
  4451. <a name="l04362"></a>04362 <span class="keywordflow">for</span> (j=0 ; j &lt; <a class="code" href="pumax_8c.html#ace2f02cb6559cc7f528a995935d30878">DimY</a> ; ++j)
  4452. <a name="l04363"></a>04363 {
  4453. <a name="l04364"></a>04364 <span class="keywordflow">for</span> (i=1 ; i &lt; <a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a> ; ++i)
  4454. <a name="l04365"></a>04365 {
  4455. <a name="l04366"></a>04366 Dmin[w][j] = <a class="code" href="pumax_8c.html#a3acffbd305ee72dcd4593c0d8af64a4f">MIN</a>(Dmin[w][j],Field[i+j*DimX]);
  4456. <a name="l04367"></a>04367 Dmax[w][j] = <a class="code" href="pumax_8c.html#afa99ec4acc4ecb2dc3c2d05da15d0e3f">MAX</a>(Dmax[w][j],Field[i+j*DimX]);
  4457. <a name="l04368"></a>04368 }
  4458. <a name="l04369"></a>04369 }
  4459. <a name="l04370"></a>04370 }
  4460. <a name="l04371"></a>04371
  4461. <a name="l04372"></a>04372 <span class="keywordflow">if</span> (nstep &gt; 2)
  4462. <a name="l04373"></a>04373 <span class="keywordflow">for</span> (j=0 ; j &lt; <a class="code" href="pumax_8c.html#ace2f02cb6559cc7f528a995935d30878">DimY</a> ; ++j)
  4463. <a name="l04374"></a>04374 {
  4464. <a name="l04375"></a>04375 XSetForeground(display,gc,TSColor[j]);
  4465. <a name="l04376"></a>04376 o = Dmin[w][j];
  4466. <a name="l04377"></a>04377 <span class="keywordflow">if</span> ((Dmax[w][j] - Dmin[w][j]) &gt; 1.0e-20) f = (InYSize-2) / (Dmax[w][j] - Dmin[w][j]);
  4467. <a name="l04378"></a>04378 <span class="keywordflow">else</span> f = 1.0;
  4468. <a name="l04379"></a>04379
  4469. <a name="l04380"></a>04380 <span class="keywordflow">for</span> (i=1 ; i &lt; <a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a> ; ++i)
  4470. <a name="l04381"></a>04381 {
  4471. <a name="l04382"></a>04382 TSxp[w][i].x = VGAX * i;
  4472. <a name="l04383"></a>04383 TSxp[w][i].y = InYSize - 1 - f * (Field[i+j*<a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a>] - o);
  4473. <a name="l04384"></a>04384 }
  4474. <a name="l04385"></a>04385 XDrawLines(display,pix,gc,TSxp[w]+1,DimX-1,CoordModeOrigin);
  4475. <a name="l04386"></a>04386 }
  4476. <a name="l04387"></a>04387 }
  4477. <a name="l04388"></a>04388
  4478. <a name="l04389"></a>04389 <span class="keywordflow">if</span> (PicType == <a class="code" href="pumax_8c.html#aa817497929617f9ee37a0e957c9e21e1">ISOTAB</a>)
  4479. <a name="l04390"></a>04390 {
  4480. <a name="l04391"></a>04391 XSetForeground(display,gc,BlackPix);
  4481. <a name="l04392"></a>04392 XSetBackground(display,gc,BlackPix);
  4482. <a name="l04393"></a>04393 XFillRectangle(display,pix,gc,0,0,WinXSize,InYSize);
  4483. <a name="l04394"></a>04394 XSetFont(display, gc, BigFont-&gt;fid);
  4484. <a name="l04395"></a>04395 yp = <a class="code" href="pumax_8c.html#a1d2254b4c4eccb72efc38d231910fe68">BigFontHeight</a>;
  4485. <a name="l04396"></a>04396 <span class="keywordflow">for</span> (j=0 ; j &lt; <a class="code" href="pumax_8c.html#a5f68902fe231a6694f89b7f19dd000ce">DimX</a> ; ++j)
  4486. <a name="l04397"></a>04397 <span class="keywordflow">if</span> (TSName[j][0])
  4487. <a name="l04398"></a>04398 {
  4488. <a name="l04399"></a>04399 XSetForeground(display,gc,TSColor[j]);
  4489. <a name="l04400"></a>04400 xp = <a class="code" href="pumax_8c.html#aefafab89c009b3e4258f1216ae91e76c">BigFontWidth</a>;
  4490. <a name="l04401"></a>04401 strcpy(Text,TSName[j]);
  4491. <a name="l04402"></a>04402 len = strlen(Text);
  4492. <a name="l04403"></a>04403 XDrawImageString(display,pix,gc,xp,yp,Text,len);
  4493. <a name="l04404"></a>04404 xp += XTextWidth(BigFont,Text,len);
  4494. <a name="l04405"></a>04405 <span class="keywordflow">if</span> (TSubsc[j][0])
  4495. <a name="l04406"></a>04406 {
  4496. <a name="l04407"></a>04407 XSetFont(display, gc, FixFont-&gt;fid);
  4497. <a name="l04408"></a>04408 XDrawImageString(display,pix,gc,xp,yp,TSubsc[j],strlen(TSubsc[j]));
  4498. <a name="l04409"></a>04409 XSetFont(display, gc, BigFont-&gt;fid);
  4499. <a name="l04410"></a>04410 }
  4500. <a name="l04411"></a>04411 xp = 8 * <a class="code" href="pumax_8c.html#aefafab89c009b3e4258f1216ae91e76c">BigFontWidth</a>;
  4501. <a name="l04412"></a>04412 <span class="keywordflow">if</span> (TSUnit[j][0])
  4502. <a name="l04413"></a>04413 {
  4503. <a name="l04414"></a>04414 sprintf(Text,<span class="stringliteral">&quot;= %7.3f [%s]&quot;</span>,field[j],TSUnit[j]);
  4504. <a name="l04415"></a>04415 <span class="keywordflow">if</span> (TScale[j][0]) strcat(Text,<span class="stringliteral">&quot; 10&quot;</span>);
  4505. <a name="l04416"></a>04416 len = strlen(Text);
  4506. <a name="l04417"></a>04417 XDrawImageString(display,pix,gc,xp,yp,Text,len);
  4507. <a name="l04418"></a>04418 <span class="keywordflow">if</span> (TScale[j][0] &gt; <span class="charliteral">&#39; &#39;</span>)
  4508. <a name="l04419"></a>04419 {
  4509. <a name="l04420"></a>04420 lens = strlen(TScale[j]);
  4510. <a name="l04421"></a>04421 XSetFont(display, gc, FixFont-&gt;fid);
  4511. <a name="l04422"></a>04422 XDrawImageString(display,pix,gc,xp+len*BigFontWidth,yp-BigFontHeight+FixFontHeight,TScale[j],lens);
  4512. <a name="l04423"></a>04423 XSetFont(display, gc, BigFont-&gt;fid);
  4513. <a name="l04424"></a>04424 }
  4514. <a name="l04425"></a>04425 }
  4515. <a name="l04426"></a>04426 yp += <a class="code" href="pumax_8c.html#a1d2254b4c4eccb72efc38d231910fe68">BigFontHeight</a>;
  4516. <a name="l04427"></a>04427 }
  4517. <a name="l04428"></a>04428 XSetFont(display, gc, FixFont-&gt;fid);
  4518. <a name="l04429"></a>04429 }
  4519. <a name="l04430"></a>04430
  4520. <a name="l04431"></a>04431 <span class="keywordflow">if</span> (PicType == <a class="code" href="pumax_8c.html#a4c30d0a50533694deda0fcf3551b6935">ISOTRA</a>)
  4521. <a name="l04432"></a>04432 {
  4522. <a name="l04433"></a>04433 XSetForeground(display,gc,BlackPix);
  4523. <a name="l04434"></a>04434 XFillRectangle(display,pix,gc,0,0,WinXSize,InYSize);
  4524. <a name="l04435"></a>04435 <span class="keywordflow">if</span> (SizeChanged) <a class="code" href="pumax_8c.html#af2e92313aaf18974c4fa6c1cb34cd7a3">ClearTracer</a>();
  4525. <a name="l04436"></a>04436 <a class="code" href="pumax_8c.html#ab15932b28ace63693c23be5e639ed1d9">TracerPlot</a>(w);
  4526. <a name="l04437"></a>04437 }
  4527. <a name="l04438"></a>04438 <span class="keywordflow">if</span> (PicType == <a class="code" href="pumax_8c.html#a1572b520f538d357372e96d0185275e5">MAPTRA</a>)
  4528. <a name="l04439"></a>04439 {
  4529. <a name="l04440"></a>04440 <span class="keywordflow">if</span> (SizeChanged) <a class="code" href="pumax_8c.html#af2e92313aaf18974c4fa6c1cb34cd7a3">ClearTracer</a>();
  4530. <a name="l04441"></a>04441 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a0aac8b0778521c19e621a6b60b3e1a4b">MapHR</a>.<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a>)
  4531. <a name="l04442"></a>04442 {
  4532. <a name="l04443"></a>04443 <span class="keywordflow">if</span> (MapPro[w] == <a class="code" href="pumax_8c.html#aae4090be0e30c18b0f22650479767d8f">AZIMUTHAL</a>)
  4533. <a name="l04444"></a>04444 {
  4534. <a name="l04445"></a>04445 <span class="keywordflow">if</span> (RedrawFlag[w] || <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].w != WinXSize || <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].h != InYSize ||
  4535. <a name="l04446"></a>04446 (nstep % rmui == 0 &amp;&amp; <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].f != 0))
  4536. <a name="l04447"></a>04447 {
  4537. <a name="l04448"></a>04448 RedrawFlag[w] = 0;
  4538. <a name="l04449"></a>04449 <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a> = <a class="code" href="pumax_8c.html#a90fa18336f52663513916236b6c3f633">WinXSize</a>;
  4539. <a name="l04450"></a>04450 <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].<a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a> = <a class="code" href="pumax_8c.html#a2e0311fae05aa716cc8cd6669af5bf3a">InYSize</a>;
  4540. <a name="l04451"></a>04451 <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].<a class="code" href="struct_map_image_struct.html#a46fe3297a24177fa1aef6e5cf19a4b4b">l</a> += <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].<a class="code" href="struct_map_image_struct.html#a0c135dc0852d411fd87b7ac84ba55664">r</a>;
  4541. <a name="l04452"></a>04452 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].l &lt; -180.0) <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].<a class="code" href="struct_map_image_struct.html#a46fe3297a24177fa1aef6e5cf19a4b4b">l</a> += 360.0;
  4542. <a name="l04453"></a>04453 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].l &gt; 180.0) <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].<a class="code" href="struct_map_image_struct.html#a46fe3297a24177fa1aef6e5cf19a4b4b">l</a> -= 360.0;
  4543. <a name="l04454"></a>04454 <a class="code" href="pumax_8c.html#ad027458730957d93b4a352feed5ea06d">AzimuthalImage</a>(&amp;<a class="code" href="pumax_8c.html#a0aac8b0778521c19e621a6b60b3e1a4b">MapHR</a>,&amp;<a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w]);
  4544. <a name="l04455"></a>04455 }
  4545. <a name="l04456"></a>04456 }
  4546. <a name="l04457"></a>04457 <span class="keywordflow">else</span>
  4547. <a name="l04458"></a>04458 {
  4548. <a name="l04459"></a>04459 <span class="keywordflow">if</span> (RedrawFlag[w] || <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].w != WinXSize || <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].h != InYSize)
  4549. <a name="l04460"></a>04460 {
  4550. <a name="l04461"></a>04461 RedrawFlag[w] = 0;
  4551. <a name="l04462"></a>04462 <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a> = <a class="code" href="pumax_8c.html#a90fa18336f52663513916236b6c3f633">WinXSize</a>;
  4552. <a name="l04463"></a>04463 <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].<a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a> = <a class="code" href="pumax_8c.html#a2e0311fae05aa716cc8cd6669af5bf3a">InYSize</a>;
  4553. <a name="l04464"></a>04464 <span class="keywordflow">if</span> (MapPro[w] == 1) <a class="code" href="pumax_8c.html#a2a67fb15956dca4db41c85496c11240e">PolarImage</a>(&amp;<a class="code" href="pumax_8c.html#a0aac8b0778521c19e621a6b60b3e1a4b">MapHR</a>,&amp;<a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w]);
  4554. <a name="l04465"></a>04465 <span class="keywordflow">else</span> <a class="code" href="pumax_8c.html#a662cbf19367e08f6e376f8d1e3b765e0">ScaleImage</a>(&amp;<a class="code" href="pumax_8c.html#a0aac8b0778521c19e621a6b60b3e1a4b">MapHR</a>,&amp;<a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w]);
  4555. <a name="l04466"></a>04466 }
  4556. <a name="l04467"></a>04467 }
  4557. <a name="l04468"></a>04468 XPutImage(display,pix,gc,<a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].X,0,0,0,0,<a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].w,<a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].h);
  4558. <a name="l04469"></a>04469 }
  4559. <a name="l04470"></a>04470 <span class="keywordflow">else</span>
  4560. <a name="l04471"></a>04471 {
  4561. <a name="l04472"></a>04472 XSetForeground(display,gc,BlackPix);
  4562. <a name="l04473"></a>04473 XFillRectangle(display,pix,gc,0,0,WinXSize,InYSize);
  4563. <a name="l04474"></a>04474 }
  4564. <a name="l04475"></a>04475 <a class="code" href="pumax_8c.html#ab15932b28ace63693c23be5e639ed1d9">TracerPlot</a>(w);
  4565. <a name="l04476"></a>04476 }
  4566. <a name="l04477"></a>04477 <span class="keywordflow">if</span> (PicType == <a class="code" href="pumax_8c.html#afc9e7bd37f3dc38ff12cdf5edb85a6d2">ISOCS</a> || PicType == <a class="code" href="pumax_8c.html#a2f1d89ef346ef5189b556085f4553c4c">ISOHOR</a> || PicType == <a class="code" href="pumax_8c.html#ad3652a10b82037800a3efb555fb7833c">ISOLON</a> || PicType == <a class="code" href="pumax_8c.html#a35e0c3caf44835d5c02d3af3b975e21b">ISOCOL</a>)
  4567. <a name="l04478"></a>04478 {
  4568. <a name="l04479"></a>04479 XSetForeground(display,gc,BlackPix);
  4569. <a name="l04480"></a>04480 XFillRectangle(display,pix,gc,0,0,WinXSize,InYSize);
  4570. <a name="l04481"></a>04481 <a class="code" href="pumax_8c.html#a84c2cc0435ae795bd3d15064ffea1501">IsoAreas</a>(Cstrip);
  4571. <a name="l04482"></a>04482 <a class="code" href="pumax_8c.html#a7e589e7ff7d5125738a34547b5756253">IsoLines</a>(Cstrip,0);
  4572. <a name="l04483"></a>04483 }
  4573. <a name="l04484"></a>04484 <span class="keywordflow">if</span> (PicType == <a class="code" href="pumax_8c.html#a3e3bcad4c273544328bcdcaef35c3852">MAPHOR</a>)
  4574. <a name="l04485"></a>04485 {
  4575. <a name="l04486"></a>04486 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a0aac8b0778521c19e621a6b60b3e1a4b">MapHR</a>.<a class="code" href="struct_map_image_struct.html#aaa7ba55126fe38d8113c9143d2528560">X</a>)
  4576. <a name="l04487"></a>04487 {
  4577. <a name="l04488"></a>04488 <span class="keywordflow">if</span> (MapPro[w] == <a class="code" href="pumax_8c.html#aae4090be0e30c18b0f22650479767d8f">AZIMUTHAL</a>)
  4578. <a name="l04489"></a>04489 {
  4579. <a name="l04490"></a>04490 <span class="keywordflow">if</span> (RedrawFlag[w] || <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].w != WinXSize || <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].h != InYSize ||
  4580. <a name="l04491"></a>04491 (nstep % rmui == 0 &amp;&amp; <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].f != 0))
  4581. <a name="l04492"></a>04492 {
  4582. <a name="l04493"></a>04493 RedrawFlag[w] = 0;
  4583. <a name="l04494"></a>04494 <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a> = <a class="code" href="pumax_8c.html#a90fa18336f52663513916236b6c3f633">WinXSize</a>;
  4584. <a name="l04495"></a>04495 <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].<a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a> = <a class="code" href="pumax_8c.html#a2e0311fae05aa716cc8cd6669af5bf3a">InYSize</a>;
  4585. <a name="l04496"></a>04496 <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].<a class="code" href="struct_map_image_struct.html#a46fe3297a24177fa1aef6e5cf19a4b4b">l</a> += <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].<a class="code" href="struct_map_image_struct.html#a0c135dc0852d411fd87b7ac84ba55664">r</a>;
  4586. <a name="l04497"></a>04497 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].l &lt; -180.0) <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].<a class="code" href="struct_map_image_struct.html#a46fe3297a24177fa1aef6e5cf19a4b4b">l</a> += 360.0;
  4587. <a name="l04498"></a>04498 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].l &gt; 180.0) <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].<a class="code" href="struct_map_image_struct.html#a46fe3297a24177fa1aef6e5cf19a4b4b">l</a> -= 360.0;
  4588. <a name="l04499"></a>04499 <a class="code" href="pumax_8c.html#ad027458730957d93b4a352feed5ea06d">AzimuthalImage</a>(&amp;<a class="code" href="pumax_8c.html#a0aac8b0778521c19e621a6b60b3e1a4b">MapHR</a>,&amp;<a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w]);
  4589. <a name="l04500"></a>04500 }
  4590. <a name="l04501"></a>04501 XPutImage(display,pix,gc,<a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].X,0,0,0,0,<a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].w,<a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].h);
  4591. <a name="l04502"></a>04502 <a class="code" href="pumax_8c.html#aa0f5f3d7c6ce01b3b6fda010e082dd77">MapLines</a>(Cstrip,1);
  4592. <a name="l04503"></a>04503 }
  4593. <a name="l04504"></a>04504 <span class="keywordflow">else</span>
  4594. <a name="l04505"></a>04505 {
  4595. <a name="l04506"></a>04506 <span class="keywordflow">if</span> (RedrawFlag[w] || <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].w != WinXSize || <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].h != InYSize)
  4596. <a name="l04507"></a>04507 {
  4597. <a name="l04508"></a>04508 RedrawFlag[w] = 0;
  4598. <a name="l04509"></a>04509 <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].<a class="code" href="struct_map_image_struct.html#a231ed4c4f5df4b3c414fe643d139bea8">w</a> = <a class="code" href="pumax_8c.html#a90fa18336f52663513916236b6c3f633">WinXSize</a>;
  4599. <a name="l04510"></a>04510 <a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].<a class="code" href="struct_map_image_struct.html#a7c1e3b72791d55ecbe02d3325a69f882">h</a> = <a class="code" href="pumax_8c.html#a2e0311fae05aa716cc8cd6669af5bf3a">InYSize</a>;
  4600. <a name="l04511"></a>04511 <span class="keywordflow">if</span> (MapPro[w] == 1) <a class="code" href="pumax_8c.html#a2a67fb15956dca4db41c85496c11240e">PolarImage</a>(&amp;<a class="code" href="pumax_8c.html#a0aac8b0778521c19e621a6b60b3e1a4b">MapHR</a>,&amp;<a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w]);
  4601. <a name="l04512"></a>04512 <span class="keywordflow">else</span> <a class="code" href="pumax_8c.html#a662cbf19367e08f6e376f8d1e3b765e0">ScaleImage</a>(&amp;<a class="code" href="pumax_8c.html#a0aac8b0778521c19e621a6b60b3e1a4b">MapHR</a>,&amp;<a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w]);
  4602. <a name="l04513"></a>04513 }
  4603. <a name="l04514"></a>04514 XPutImage(display,pix,gc,<a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].X,0,0,0,0,<a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].w,<a class="code" href="pumax_8c.html#aa30070ce7cfd3502c505f83464d79510">MapLR</a>[w].h);
  4604. <a name="l04515"></a>04515 <a class="code" href="pumax_8c.html#a7e589e7ff7d5125738a34547b5756253">IsoLines</a>(Cstrip,1);
  4605. <a name="l04516"></a>04516 }
  4606. <a name="l04517"></a>04517 }
  4607. <a name="l04518"></a>04518 <span class="keywordflow">else</span>
  4608. <a name="l04519"></a>04519 {
  4609. <a name="l04520"></a>04520 XSetForeground(display,gc,BlackPix);
  4610. <a name="l04521"></a>04521 XFillRectangle(display,pix,gc,0,0,WinXSize,InYSize);
  4611. <a name="l04522"></a>04522 <a class="code" href="pumax_8c.html#a7e589e7ff7d5125738a34547b5756253">IsoLines</a>(Cstrip,1);
  4612. <a name="l04523"></a>04523 }
  4613. <a name="l04524"></a>04524 }
  4614. <a name="l04525"></a>04525 <span class="keywordflow">if</span> (PicType == <a class="code" href="pumax_8c.html#a5cacfe29b73c60abfa48f1ab23b8d631">ISOHOV</a>)
  4615. <a name="l04526"></a>04526 {
  4616. <a name="l04527"></a>04527 <a class="code" href="pumax_8c.html#a84c2cc0435ae795bd3d15064ffea1501">IsoAreas</a>(Cstrip);
  4617. <a name="l04528"></a>04528 }
  4618. <a name="l04529"></a>04529
  4619. <a name="l04530"></a>04530 <span class="keywordflow">if</span> (PicType == <a class="code" href="pumax_8c.html#ae41274f4b33dfd046884def7709aa887">ISOSH</a>)
  4620. <a name="l04531"></a>04531 {
  4621. <a name="l04532"></a>04532 <a class="code" href="pumax_8c.html#aed8ad522611a864b8abd8b245d68ceac">AmplitudePlot</a>();
  4622. <a name="l04533"></a>04533 }
  4623. <a name="l04534"></a>04534
  4624. <a name="l04535"></a>04535 <span class="keywordflow">if</span> (Grid &amp;&amp; PicType == <a class="code" href="pumax_8c.html#afc9e7bd37f3dc38ff12cdf5edb85a6d2">ISOCS</a>) <a class="code" href="pumax_8c.html#a76fadfb9ad5d4b5629b491009adc18ee">ShowGridCS</a>();
  4625. <a name="l04536"></a>04536 <span class="keywordflow">if</span> (Grid &amp;&amp; PicType == <a class="code" href="pumax_8c.html#ad3652a10b82037800a3efb555fb7833c">ISOLON</a>) <a class="code" href="pumax_8c.html#a48f79382d1404129c81412462243a5bd">ShowGridLonsi</a>();
  4626. <a name="l04537"></a>04537 <span class="keywordflow">if</span> (Grid &amp;&amp; PicType == <a class="code" href="pumax_8c.html#a5cacfe29b73c60abfa48f1ab23b8d631">ISOHOV</a> &amp;&amp; MapPro[w] == 0) <a class="code" href="pumax_8c.html#a5a4a6887dea464a44006a936603a6a91">ShowGridHov</a>();
  4627. <a name="l04538"></a>04538 <span class="keywordflow">if</span> (Grid &amp;&amp; PicType == <a class="code" href="pumax_8c.html#a5cacfe29b73c60abfa48f1ab23b8d631">ISOHOV</a> &amp;&amp; MapPro[w] == 1) <a class="code" href="pumax_8c.html#ae9322503c9ee71d24ed929c4433b81f0">ShowGridHovT</a>();
  4628. <a name="l04539"></a>04539 <span class="keywordflow">if</span> (PicType == <a class="code" href="pumax_8c.html#a2f1d89ef346ef5189b556085f4553c4c">ISOHOR</a> &amp;&amp; MapPro[w] == 1) <a class="code" href="pumax_8c.html#a8736525de26ffa57c6d3f302e0464e88">ShowGridPolar</a>();
  4629. <a name="l04540"></a>04540 <span class="keywordflow">if</span> (Grid &amp;&amp; PicType == <a class="code" href="pumax_8c.html#a2f1d89ef346ef5189b556085f4553c4c">ISOHOR</a> &amp;&amp; MapPro[w] == 0) <a class="code" href="pumax_8c.html#a3c6f5ed7ed2b12beb152524aef7c8670">ShowGridCyl</a>();
  4630. <a name="l04541"></a>04541 <span class="keywordflow">if</span> (Grid &amp;&amp; PicType == <a class="code" href="pumax_8c.html#a35e0c3caf44835d5c02d3af3b975e21b">ISOCOL</a>) <a class="code" href="pumax_8c.html#a1605a005c902c708301c522cb78ed5d9">ShowGridCol</a>();
  4631. <a name="l04542"></a>04542
  4632. <a name="l04543"></a>04543 XCopyArea(display,pix,Win[w],gc,0,0,WinXSize,WinYSize,0,0);
  4633. <a name="l04544"></a>04544 }
  4634. <a name="l04545"></a>04545
  4635. <a name="l04546"></a>04546
  4636. <a name="l04547"></a>04547 <span class="comment">/* ==================================================================== */</span>
  4637. <a name="l04548"></a>04548 <span class="comment">/* iguistep - this function is called from the model for every timestep */</span>
  4638. <a name="l04549"></a>04549 <span class="comment">/* ==================================================================== */</span>
  4639. <a name="l04550"></a>04550
  4640. <a name="l04551"></a><a class="code" href="pumax_8c.html#adc182edd121e09db57e951fb245f2708">04551</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#adc182edd121e09db57e951fb245f2708">iguistep_</a>(<span class="keywordtype">float</span> pparcs[],<span class="keywordtype">int</span> kdatim[])
  4641. <a name="l04552"></a>04552 {
  4642. <a name="l04553"></a>04553 <span class="keywordtype">int</span> i,j,w; <span class="comment">// Loop indices</span>
  4643. <a name="l04554"></a>04554 <span class="keyword">struct </span>timeval TimeVal; <span class="comment">// Retrieve time info</span>
  4644. <a name="l04555"></a>04555
  4645. <a name="l04556"></a>04556 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">Debug</a>) printf(<span class="stringliteral">&quot;iguistep(%12.2e,%d-%d-%d)\n&quot;</span>,
  4646. <a name="l04557"></a>04557 pparcs[0],kdatim[0],kdatim[1],kdatim[2]);
  4647. <a name="l04558"></a>04558 nstep++;
  4648. <a name="l04559"></a>04559 memcpy(ndatim,kdatim,<span class="keyword">sizeof</span>(ndatim));
  4649. <a name="l04560"></a>04560 DeltaTime = ndatim[4] - <a class="code" href="pumax_8c.html#a431f109cd0fda419267defc94d5e4926">LastMinute</a>;
  4650. <a name="l04561"></a>04561 <span class="keywordflow">if</span> (DeltaTime &lt; 0) DeltaTime += 60;
  4651. <a name="l04562"></a>04562 <span class="keywordflow">if</span> (DeltaTime ==0) DeltaTime = 60;
  4652. <a name="l04563"></a>04563 LastMinute = ndatim[4];
  4653. <a name="l04564"></a>04564
  4654. <a name="l04565"></a>04565 <span class="comment">// Compute frames per second every 20 calls</span>
  4655. <a name="l04566"></a>04566
  4656. <a name="l04567"></a>04567 gettimeofday(&amp;TimeVal,NULL);
  4657. <a name="l04568"></a>04568 LastSecond = <a class="code" href="pumax_8c.html#af22e8278c499183a077f11d9f2aa1922">ThisSecond</a>;
  4658. <a name="l04569"></a>04569 ThisSecond = TimeVal.tv_sec;
  4659. <a name="l04570"></a>04570
  4660. <a name="l04571"></a>04571 <span class="keywordflow">if</span> (SecEvent = ThisSecond &gt; LastSecond)
  4661. <a name="l04572"></a>04572 {
  4662. <a name="l04573"></a>04573 fps = nstep - <a class="code" href="pumax_8c.html#af0d7de5b658838770aedc6e81c2bfbba">LastStep</a>;
  4663. <a name="l04574"></a>04574 LastStep = <a class="code" href="pumax_8c.html#a354c90bb46e1789fe52c4759474c2c89">nstep</a>;
  4664. <a name="l04575"></a>04575 rmui = fps / <a class="code" href="pumax_8c.html#abbe54d9d31d45c4bf9b3881ab71b3d9d">rmuf</a>;
  4665. <a name="l04576"></a>04576 <span class="keywordflow">if</span> (rmui &lt; 1) rmui = 1;
  4666. <a name="l04577"></a>04577 }
  4667. <a name="l04578"></a>04578
  4668. <a name="l04579"></a>04579 SkipFreq = 1 + fps / 30; <span class="comment">// Reduce plot rate on fast cpu&#39;s</span>
  4669. <a name="l04580"></a>04580 <span class="keywordflow">if</span> (SkipFreq &lt; 0 || SkipFreq &gt; 10) SkipFreq = 0;
  4670. <a name="l04581"></a>04581
  4671. <a name="l04582"></a>04582 <span class="keywordflow">for</span> (w=0 ; w &lt; <a class="code" href="pumax_8c.html#a2364498cd60ebd2201eeef32ce76e882">NumWin</a> ; ++w)
  4672. <a name="l04583"></a>04583 {
  4673. <a name="l04584"></a>04584 <span class="keywordflow">for</span> (j=0 ; j &lt; <a class="code" href="pumax_8c.html#a66a0f3add0dee72c7f3811b88249a9b6">NumArrays</a> ; ++j)
  4674. <a name="l04585"></a>04585 {
  4675. <a name="l04586"></a>04586 <span class="keywordflow">if</span> (!strcmp(<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].array_name,<a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[j].Name))
  4676. <a name="l04587"></a>04587 {
  4677. <a name="l04588"></a>04588 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[j].Flag || RedrawFlag[w])
  4678. <a name="l04589"></a>04589 <a class="code" href="pumax_8c.html#a6d3107848ccc42cc33820aad454e7fcb">iso</a>(w,<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].Plot,<a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[j].Data,<a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[j].DimX,<a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[j].DimY,
  4679. <a name="l04590"></a>04590 <a class="code" href="pumax_8c.html#aa0260a08bcef20dcd8166c713c0bd381">Array</a>[j].DimZ,<a class="code" href="pumax_8c.html#a4f22d34c7ff93ae8a224a49744142661">WinAtt</a>[w].Palette);
  4680. <a name="l04591"></a>04591 }
  4681. <a name="l04592"></a>04592 }
  4682. <a name="l04593"></a>04593 }
  4683. <a name="l04594"></a>04594
  4684. <a name="l04595"></a>04595 <span class="keywordflow">for</span> (i=0 ; i &lt; <a class="code" href="pumax_8c.html#a4444b7b37748213e596d8d51dfdb3315">Parcs</a> ; ++i) <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[i].Val = pparcs[i];
  4685. <a name="l04596"></a>04596 <a class="code" href="pumax_8c.html#acf33d3bfa71c46444f4f80e09ee4b9c6">ShowStep</a>();
  4686. <a name="l04597"></a>04597 <a class="code" href="pumax_8c.html#a556605526426c716c92badd69589728a">ShowParcs</a>();
  4687. <a name="l04598"></a>04598 <a class="code" href="pumax_8c.html#a5d7b22836449266ba8bd29a5f83e3c2b">HandleEvents</a>();
  4688. <a name="l04599"></a>04599 <span class="keywordflow">if</span> (XCheckTypedWindowEvent(display,Cow,Expose,&amp;CowEvent))
  4689. <a name="l04600"></a>04600 <a class="code" href="pumax_8c.html#a41f77efa657ce06e158034152384bf2e">RedrawControlWindow</a>();
  4690. <a name="l04601"></a>04601 <span class="keywordflow">for</span> (i=0 ; i &lt; <a class="code" href="pumax_8c.html#a4444b7b37748213e596d8d51dfdb3315">Parcs</a> ; ++i) pparcs[i] = <a class="code" href="pumax_8c.html#a1ff2b68fd3766107233f373cca6fd2ef">Parc</a>[i].Val;
  4691. <a name="l04602"></a>04602
  4692. <a name="l04603"></a>04603 XSync(display,1);
  4693. <a name="l04604"></a>04604 <span class="keywordflow">if</span> (Shutdown &amp;&amp; MRpid &lt; 1) <a class="code" href="pumax_8c.html#aeddd52f215d48c55293dfbc55156c780">SaveConfig</a>();
  4694. <a name="l04605"></a>04605 <span class="keywordflow">if</span> (<a class="code" href="pumax_8c.html#a923774364cedbc16baa0bc05e9be136c">Debug</a>) printf(<span class="stringliteral">&quot;iguistep returns %d\n&quot;</span>,Shutdown);
  4695. <a name="l04606"></a>04606 <span class="keywordflow">return</span> <a class="code" href="pumax_8c.html#ab21d9f37528b86a902a6729dd95ac59c">Shutdown</a>;
  4696. <a name="l04607"></a>04607 }
  4697. <a name="l04608"></a>04608
  4698. <a name="l04609"></a><a class="code" href="pumax_8c.html#a495f2e0742e95d86d37335ea01a248a1">04609</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a495f2e0742e95d86d37335ea01a248a1">nresources_</a>(<span class="keywordtype">double</span> *ut, <span class="keywordtype">double</span> *st, <span class="keywordtype">long</span> *mem, <span class="keywordtype">long</span> *par, <span class="keywordtype">long</span> *paf,
  4699. <a name="l04610"></a>04610 <span class="keywordtype">long</span> *swa, <span class="keywordtype">long</span> *dr, <span class="keywordtype">long</span> *dw)
  4700. <a name="l04611"></a>04611 {
  4701. <a name="l04612"></a>04612 <span class="keyword">struct </span>rusage ru;
  4702. <a name="l04613"></a>04613 getrusage(RUSAGE_SELF,&amp;ru);
  4703. <a name="l04614"></a>04614 *ut = ru.ru_utime.tv_sec + 0.000001 * ru.ru_utime.tv_usec;
  4704. <a name="l04615"></a>04615 *st = ru.ru_stime.tv_sec + 0.000001 * ru.ru_stime.tv_usec;
  4705. <a name="l04616"></a>04616 *mem = ru.ru_maxrss;
  4706. <a name="l04617"></a>04617 *par = ru.ru_minflt;
  4707. <a name="l04618"></a>04618 *paf = ru.ru_majflt;
  4708. <a name="l04619"></a>04619 *swa = ru.ru_nswap;
  4709. <a name="l04620"></a>04620 *dr = ru.ru_inblock;
  4710. <a name="l04621"></a>04621 *dw = ru.ru_oublock;
  4711. <a name="l04622"></a>04622 <span class="keywordflow">return</span> 1;
  4712. <a name="l04623"></a>04623 }
  4713. <a name="l04624"></a>04624
  4714. <a name="l04625"></a>04625 <span class="comment">/* ------------------------------------------------ */</span>
  4715. <a name="l04626"></a>04626 <span class="comment">/* Stub routines for Absoft Compiler and others, */</span>
  4716. <a name="l04627"></a>04627 <span class="comment">/* which require, that FORTRAN callable C-functions */</span>
  4717. <a name="l04628"></a>04628 <span class="comment">/* are written in uppercase letters only */</span>
  4718. <a name="l04629"></a>04629 <span class="comment">/* ------------------------------------------------ */</span>
  4719. <a name="l04630"></a>04630
  4720. <a name="l04631"></a>04631
  4721. <a name="l04632"></a><a class="code" href="pumax_8c.html#aa2c3ce5eee87810f607d037c142d4be0">04632</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#aa2c3ce5eee87810f607d037c142d4be0">INITGUI</a>(<span class="keywordtype">int</span> *model, <span class="keywordtype">int</span> *debug, <span class="keywordtype">int</span> *lats, <span class="keywordtype">int</span> *mrpid, <span class="keywordtype">int</span> *mrnum)
  4722. <a name="l04633"></a>04633 {
  4723. <a name="l04634"></a>04634 <a class="code" href="pumax_8c.html#a3112b5a95104da13f9d136d080a9571a">initgui_</a>(model,debug,lats,mrpid,mrnum);
  4724. <a name="l04635"></a>04635 }
  4725. <a name="l04636"></a>04636
  4726. <a name="l04637"></a><a class="code" href="pumax_8c.html#a867be165f65572704f06ba921150544f">04637</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a867be165f65572704f06ba921150544f">GUICLOSE</a>(<span class="keywordtype">void</span>)
  4727. <a name="l04638"></a>04638 {
  4728. <a name="l04639"></a>04639 <a class="code" href="pumax_8c.html#a3e6d6484cbc802c71aa4d660b3e6298c">guiclose_</a>();
  4729. <a name="l04640"></a>04640 }
  4730. <a name="l04641"></a>04641
  4731. <a name="l04642"></a><a class="code" href="pumax_8c.html#ae32337d64b01e9fef3951ac55a34c82d">04642</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#ae32337d64b01e9fef3951ac55a34c82d">IGUISTEP</a>(<span class="keywordtype">float</span> pparcs[], <span class="keywordtype">int</span> kdatim[])
  4732. <a name="l04643"></a>04643 {
  4733. <a name="l04644"></a>04644 <span class="keywordflow">return</span> <a class="code" href="pumax_8c.html#adc182edd121e09db57e951fb245f2708">iguistep_</a>(pparcs,kdatim);
  4734. <a name="l04645"></a>04645 }
  4735. <a name="l04646"></a>04646
  4736. <a name="l04647"></a><a class="code" href="pumax_8c.html#a0397119cd5422233207fb351e546efea">04647</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a0397119cd5422233207fb351e546efea">GUIPUT</a>(<span class="keywordtype">char</span> *aname, <span class="keywordtype">float</span> *array, <span class="keywordtype">int</span> *dimx, <span class="keywordtype">int</span> *dimy, <span class="keywordtype">int</span> *dimz)
  4737. <a name="l04648"></a>04648 {
  4738. <a name="l04649"></a>04649 <a class="code" href="pumax_8c.html#a583096811c0b0b458ad353d0e09e75a0">guiput_</a>(aname, array, dimx, dimy, dimz);
  4739. <a name="l04650"></a>04650 }
  4740. <a name="l04651"></a>04651
  4741. <a name="l04652"></a><a class="code" href="pumax_8c.html#a7856e9415ba484949a3cefeac70c1c8c">04652</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a7856e9415ba484949a3cefeac70c1c8c">NRESOURCES</a>(<span class="keywordtype">double</span> *ut, <span class="keywordtype">double</span> *st, <span class="keywordtype">long</span> *mem, <span class="keywordtype">long</span> *par, <span class="keywordtype">long</span> *paf,
  4742. <a name="l04653"></a>04653 <span class="keywordtype">long</span> *swa, <span class="keywordtype">long</span> *dr, <span class="keywordtype">long</span> *dw)
  4743. <a name="l04654"></a>04654 {
  4744. <a name="l04655"></a>04655 <span class="keywordflow">return</span> <a class="code" href="pumax_8c.html#a495f2e0742e95d86d37335ea01a248a1">nresources_</a>(ut,st,mem,par,paf,swa,dr,dw);
  4745. <a name="l04656"></a>04656 }
  4746. <a name="l04657"></a>04657
  4747. <a name="l04658"></a>04658 <span class="comment">/* ------------------------------------------------ */</span>
  4748. <a name="l04659"></a>04659 <span class="comment">/* Stub routines for IBM Compiler and others, */</span>
  4749. <a name="l04660"></a>04660 <span class="comment">/* which require, that FORTRAN callable C-functions */</span>
  4750. <a name="l04661"></a>04661 <span class="comment">/* are written in lowercase without underscore */</span>
  4751. <a name="l04662"></a>04662 <span class="comment">/* ------------------------------------------------ */</span>
  4752. <a name="l04663"></a>04663
  4753. <a name="l04664"></a>04664
  4754. <a name="l04665"></a><a class="code" href="pumax_8c.html#a1de39836b6c983abd5014eca3b58fb6b">04665</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a1de39836b6c983abd5014eca3b58fb6b">initgui</a>(<span class="keywordtype">int</span> *model, <span class="keywordtype">int</span> *debug, <span class="keywordtype">int</span> *lats, <span class="keywordtype">int</span> *mrpid, <span class="keywordtype">int</span> *mrnum)
  4755. <a name="l04666"></a>04666 {
  4756. <a name="l04667"></a>04667 <a class="code" href="pumax_8c.html#a3112b5a95104da13f9d136d080a9571a">initgui_</a>(model,debug,lats,mrpid,mrnum);
  4757. <a name="l04668"></a>04668 }
  4758. <a name="l04669"></a>04669
  4759. <a name="l04670"></a><a class="code" href="pumax_8c.html#a5bcccf3b585aabc714dbb0e554817e11">04670</a> <span class="keywordtype">void</span> <a class="code" href="pumax_8c.html#a5bcccf3b585aabc714dbb0e554817e11">guiclose</a>(<span class="keywordtype">void</span>)
  4760. <a name="l04671"></a>04671 {
  4761. <a name="l04672"></a>04672 <a class="code" href="pumax_8c.html#a3e6d6484cbc802c71aa4d660b3e6298c">guiclose_</a>();
  4762. <a name="l04673"></a>04673 }
  4763. <a name="l04674"></a>04674
  4764. <a name="l04675"></a><a class="code" href="pumax_8c.html#a5379e44b382c3d382ad16a9b37d671bc">04675</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a5379e44b382c3d382ad16a9b37d671bc">iguistep</a>(<span class="keywordtype">float</span> pparcs[], <span class="keywordtype">int</span> kdatim[])
  4765. <a name="l04676"></a>04676 {
  4766. <a name="l04677"></a>04677 <span class="keywordflow">return</span> <a class="code" href="pumax_8c.html#adc182edd121e09db57e951fb245f2708">iguistep_</a>(pparcs,kdatim);
  4767. <a name="l04678"></a>04678 }
  4768. <a name="l04679"></a>04679
  4769. <a name="l04680"></a><a class="code" href="pumax_8c.html#a1adce4616e171ccfe8ad9f68bc10cdd2">04680</a> <span class="keywordtype">void</span> <a class="code" href="guimod__stub_8f90.html#a246c916d08a954310ea15d64816db13b">guiput</a>(<span class="keywordtype">char</span> *aname, <span class="keywordtype">float</span> *array, <span class="keywordtype">int</span> *dimx, <span class="keywordtype">int</span> *dimy, <span class="keywordtype">int</span> *dimz)
  4770. <a name="l04681"></a>04681 {
  4771. <a name="l04682"></a>04682 <a class="code" href="pumax_8c.html#a583096811c0b0b458ad353d0e09e75a0">guiput_</a>(aname, array, dimx, dimy, dimz);
  4772. <a name="l04683"></a>04683 }
  4773. <a name="l04684"></a>04684
  4774. <a name="l04685"></a><a class="code" href="pumax_8c.html#a2d3f1fbf60f69e64a1d803256c837890">04685</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a2d3f1fbf60f69e64a1d803256c837890">iguinan_</a>(<span class="keywordtype">double</span> *p)
  4775. <a name="l04686"></a>04686 {
  4776. <a name="l04687"></a>04687 <span class="keywordflow">return</span> isnan(*p);
  4777. <a name="l04688"></a>04688 }
  4778. <a name="l04689"></a>04689
  4779. <a name="l04690"></a><a class="code" href="pumax_8c.html#a7e885dd959a1c4e56017782911c1f796">04690</a> <span class="keywordtype">int</span> <a class="code" href="pumax_8c.html#a7e885dd959a1c4e56017782911c1f796">nresources</a>(<span class="keywordtype">double</span> *ut, <span class="keywordtype">double</span> *st, <span class="keywordtype">long</span> *mem, <span class="keywordtype">long</span> *par, <span class="keywordtype">long</span> *paf,
  4780. <a name="l04691"></a>04691 <span class="keywordtype">long</span> *swa, <span class="keywordtype">long</span> *dr, <span class="keywordtype">long</span> *dw)
  4781. <a name="l04692"></a>04692 {
  4782. <a name="l04693"></a>04693 <span class="keywordflow">return</span> <a class="code" href="pumax_8c.html#a495f2e0742e95d86d37335ea01a248a1">nresources_</a>(ut,st,mem,par,paf,swa,dr,dw);
  4783. <a name="l04694"></a>04694 }
  4784. </pre></div></div>
  4785. </div>
  4786. <div id="nav-path" class="navpath">
  4787. <ul>
  4788. <li class="navelem"><a class="el" href="pumax_8c.html">pumax.c</a> </li>
  4789. <!-- window showing the filter options -->
  4790. <div id="MSearchSelectWindow"
  4791. onmouseover="return searchBox.OnSearchSelectShow()"
  4792. onmouseout="return searchBox.OnSearchSelectHide()"
  4793. onkeydown="return searchBox.OnSearchSelectKey(event)">
  4794. <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Defines</a></div>
  4795. <!-- iframe showing the search results (closed by default) -->
  4796. <div id="MSearchResultsWindow">
  4797. <iframe src="javascript:void(0)" frameborder="0"
  4798. name="MSearchResults" id="MSearchResults">
  4799. </iframe>
  4800. </div>
  4801. <li class="footer">Generated on Wed Sep 21 2011 12:35:46 for PUMA by
  4802. <a href="http://www.doxygen.org/index.html">
  4803. <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
  4804. </ul>
  4805. </div>
  4806. </body>
  4807. </html>