| 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 2 | % nouvelle version de pst-map3d % |
|---|
| 3 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 4 | |
|---|
| 5 | \csname PSTMapThreeD\endcsname |
|---|
| 6 | \let\PSTMapThreeDLoaded\endinput |
|---|
| 7 | |
|---|
| 8 | % Require PSTricks |
|---|
| 9 | \ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi |
|---|
| 10 | \ifx\PSTnodesLoaded\endinput\else\input pst-node.tex\fi |
|---|
| 11 | \ifx\PSTXKeyLoaded\endinput\else\input pst-xkey.tex \fi |
|---|
| 12 | |
|---|
| 13 | \def\fileversion{2.0} |
|---|
| 14 | \def\filedate{2008/03/05} |
|---|
| 15 | |
|---|
| 16 | \message{`PST-map3d v\fileversion, \filedate} |
|---|
| 17 | \edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax |
|---|
| 18 | \pst@addfams{pst-map3d} |
|---|
| 19 | % |
|---|
| 20 | \definecolor{orange}{cmyk}{0,0.61,0.87,0} |
|---|
| 21 | \definecolor{darkgreen}{cmyk}{1,0,1,0.5} |
|---|
| 22 | \SpecialCoor |
|---|
| 23 | % |
|---|
| 24 | \define@key[psset]{pst-map3d}{path}{\edef\psk@WorldMap@Path{#1}} % chemin des données |
|---|
| 25 | \psset{path=data} |
|---|
| 26 | % |
|---|
| 27 | \pstheader{map3d.pro} |
|---|
| 28 | \define@key[psset]{pst-map3d}{RotX}{\edef\psk@TroisD@RotX{#1}} % rotation autour de Ox en degrés |
|---|
| 29 | \define@key[psset]{pst-map3d}{RotY}{\edef\psk@TroisD@RotY{#1}} % rotation autour de Oy en degrés |
|---|
| 30 | \define@key[psset]{pst-map3d}{RotZ}{\edef\psk@TroisD@RotZ{#1}} % rotation autour de OZ en degrés |
|---|
| 31 | \define@key[psset]{pst-map3d}{Radius}{\edef\psk@TroisD@Radius{#1}} % rayon de la sphère |
|---|
| 32 | % |
|---|
| 33 | \define@key[psset]{pst-map3d}{THETA}{\edef\psk@TroisD@Theta{#1}} |
|---|
| 34 | \define@key[psset]{pst-map3d}{PHI}{\edef\psk@TroisD@Phi{#1}} |
|---|
| 35 | \define@key[psset]{pst-map3d}{Dobs}{\edef\psk@TroisD@Dobs{#1}} |
|---|
| 36 | \define@key[psset]{pst-map3d}{Decran}{\edef\psk@TroisD@Ecran{#1}} |
|---|
| 37 | \psset{THETA=0,PHI=45,Dobs=20,Decran=25} |
|---|
| 38 | % |
|---|
| 39 | \psset{RotX=0,RotY=0,RotZ=0,Radius=5} |
|---|
| 40 | % |
|---|
| 41 | \define@key[psset]{pst-map3d}{Day}{\def\psk@WorldMap@J{#1}} |
|---|
| 42 | \define@key[psset]{pst-map3d}{Month}{\def\psk@WorldMap@M{#1}} |
|---|
| 43 | \define@key[psset]{pst-map3d}{Year}{\def\psk@WorldMap@A{#1}} |
|---|
| 44 | \psset{Day=\number\day,Month=\number\month,Year=\number\year} |
|---|
| 45 | \define@key[psset]{pst-map3d}{hour}{\edef\psk@WorldMap@hour{#1}} |
|---|
| 46 | \psset{hour=12} % en heures |
|---|
| 47 | % |
|---|
| 48 | \define@key[psset]{pst-map3d}{gridmapdiv}{\edef\psk@WorldMap@mapgriddiv{#1}} |
|---|
| 49 | \psset{gridmapdiv=10} |
|---|
| 50 | % |
|---|
| 51 | \define@key[psset]{pst-map3d}{longitudeMeridien}{\edef\psk@WorldMap@longitudeMeridien{#1}} |
|---|
| 52 | \psset{longitudeMeridien=0} |
|---|
| 53 | % |
|---|
| 54 | \newdimen\psmeridienwidth |
|---|
| 55 | \def\psset@meridienwidth#1{\pssetlength\psmeridienwidth{#1}} |
|---|
| 56 | \psset@meridienwidth{1pt} |
|---|
| 57 | % |
|---|
| 58 | \define@key[psset]{pst-map3d}{meridiencolor}{% |
|---|
| 59 | \pst@getcolor{#1}\psmeridiencolor} |
|---|
| 60 | \psset[pst-map3d]{meridiencolor=red} |
|---|
| 61 | % |
|---|
| 62 | \define@key[psset]{pst-map3d}{latitudeParallel}{\edef\psk@WorldMap@latitudeParallel{#1}} |
|---|
| 63 | \psset{latitudeParallel=0} |
|---|
| 64 | % |
|---|
| 65 | \newdimen\psparallelwidth |
|---|
| 66 | \def\psset@parallelwidth#1{\pssetlength\psparallelwidth{#1}} |
|---|
| 67 | \psset@parallelwidth{1pt} |
|---|
| 68 | % |
|---|
| 69 | \define@key[psset]{pst-map3d}{parallelcolor}{% |
|---|
| 70 | \pst@getcolor{#1}\psparallelcolor} |
|---|
| 71 | \psset[pst-map3d]{parallelcolor=red} |
|---|
| 72 | % |
|---|
| 73 | |
|---|
| 74 | \definecolor{terre}{rgb}{0.99,0.95,0.7} |
|---|
| 75 | \definecolor{mer}{rgb}{0.5,0.8,0.8} |
|---|
| 76 | \definecolor{darkblue}{cmyk}{1,1,0,0.7} |
|---|
| 77 | |
|---|
| 78 | \define@key[psset]{pst-map3d}{mapcolor}{% |
|---|
| 79 | \pst@getcolor{#1}\psmapcolor} |
|---|
| 80 | \psset[pst-map3d]{mapcolor=terre} |
|---|
| 81 | |
|---|
| 82 | \define@key[psset]{pst-map3d}{bordercolor}{% |
|---|
| 83 | \pst@getcolor{#1}\psbordercolor} |
|---|
| 84 | \psset[pst-map3d]{bordercolor=black} |
|---|
| 85 | |
|---|
| 86 | \define@key[psset]{pst-map3d}{islandcolor}{% |
|---|
| 87 | \pst@getcolor{#1}\psislandcolor} |
|---|
| 88 | \psset[pst-map3d]{islandcolor=black} |
|---|
| 89 | |
|---|
| 90 | \define@key[psset]{pst-map3d}{coastcolor}{% |
|---|
| 91 | \pst@getcolor{#1}\pscoastcolor} |
|---|
| 92 | \psset[pst-map3d]{coastcolor=black} |
|---|
| 93 | |
|---|
| 94 | \define@key[psset]{pst-map3d}{oceancolor}{% |
|---|
| 95 | \pst@getcolor{#1}\psoceancolor} |
|---|
| 96 | \psset[pst-map3d]{oceancolor=mer} |
|---|
| 97 | |
|---|
| 98 | \define@key[psset]{pst-map3d}{rivercolor}{% |
|---|
| 99 | \pst@getcolor{#1}\psrivercolor} |
|---|
| 100 | \psset[pst-map3d]{rivercolor=blue} |
|---|
| 101 | |
|---|
| 102 | \define@key[psset]{pst-map3d}{wfraczoncolor}{% |
|---|
| 103 | \pst@getcolor{#1}\pswfraczoncolor} |
|---|
| 104 | \psset[pst-map3d]{wfraczoncolor=red} |
|---|
| 105 | |
|---|
| 106 | \define@key[psset]{pst-map3d}{wmaglincolor}{% |
|---|
| 107 | \pst@getcolor{#1}\pswmaglincolor} |
|---|
| 108 | \psset[pst-map3d]{wmaglincolor=darkblue} |
|---|
| 109 | |
|---|
| 110 | \define@key[psset]{pst-map3d}{ridgecolor}{% |
|---|
| 111 | \pst@getcolor{#1}\psridgecolor} |
|---|
| 112 | \psset[pst-map3d]{ridgecolor=red} |
|---|
| 113 | |
|---|
| 114 | \define@key[psset]{pst-map3d}{transfrmcolor}{% |
|---|
| 115 | \pst@getcolor{#1}\pstransfrmcolor} |
|---|
| 116 | \psset[pst-map3d]{transfrmcolor=orange} |
|---|
| 117 | |
|---|
| 118 | \define@key[psset]{pst-map3d}{trenchcolor}{% |
|---|
| 119 | \pst@getcolor{#1}\pstrenchcolor} |
|---|
| 120 | \psset[pst-map3d]{trenchcolor=darkgreen} |
|---|
| 121 | |
|---|
| 122 | \define@key[psset]{pst-map3d}{gridmapcolor}{% |
|---|
| 123 | \pst@getcolor{#1}\psgridmapcolor} |
|---|
| 124 | \psset[pst-map3d]{gridmapcolor=black} |
|---|
| 125 | |
|---|
| 126 | \define@key[psset]{pst-map3d}{circlecolor}{% |
|---|
| 127 | \pst@getcolor{#1}\pscirclecolor} |
|---|
| 128 | \psset[pst-map3d]{circlecolor=blue} |
|---|
| 129 | |
|---|
| 130 | \define@key[psset]{pst-map3d}{circlesep}{\edef\psk@WorldMap@circlesep{#1}} |
|---|
| 131 | \psset{circlesep=2} % en degres |
|---|
| 132 | |
|---|
| 133 | \newdimen\pscirclewidth |
|---|
| 134 | \def\psset@circlewidth#1{\pssetlength\pscirclewidth{#1}} |
|---|
| 135 | \psset@circlewidth{.5pt} |
|---|
| 136 | |
|---|
| 137 | \newdimen\psgridmapwidth |
|---|
| 138 | \def\psset@gridmapwidth#1{\pssetlength\psgridmapwidth{#1}} |
|---|
| 139 | \psset@gridmapwidth{.8pt} |
|---|
| 140 | |
|---|
| 141 | \newdimen\psborderwidth |
|---|
| 142 | \def\psset@borderwidth#1{\pssetlength\psborderwidth{#1}} |
|---|
| 143 | \psset@borderwidth{.8pt} |
|---|
| 144 | |
|---|
| 145 | \newdimen\pscoastwidth |
|---|
| 146 | \def\psset@coastwidth#1{\pssetlength\pscoastwidth{#1}} |
|---|
| 147 | \psset@coastwidth{.8pt} |
|---|
| 148 | |
|---|
| 149 | \newdimen\pswfraczonwidth |
|---|
| 150 | \def\psset@wfraczonwidth#1{\pssetlength\pswfraczonwidth{#1}} |
|---|
| 151 | \psset@wfraczonwidth{.8pt} |
|---|
| 152 | |
|---|
| 153 | \newdimen\pswmaglinwidth |
|---|
| 154 | \def\psset@wmaglinwidth#1{\pssetlength\pswmaglinwidth{#1}} |
|---|
| 155 | \psset@wmaglinwidth{.8pt} |
|---|
| 156 | |
|---|
| 157 | \newdimen\psridgewidth |
|---|
| 158 | \def\psset@ridgewidth#1{\pssetlength\psridgewidth{#1}} |
|---|
| 159 | \psset@ridgewidth{2pt} |
|---|
| 160 | |
|---|
| 161 | \def\variablesTroisD{% |
|---|
| 162 | /RotX \psk@TroisD@RotX\space def |
|---|
| 163 | /RotY \psk@TroisD@RotY\space def |
|---|
| 164 | /RotZ \psk@TroisD@RotZ\space def |
|---|
| 165 | /THETA \psk@TroisD@Theta\space def |
|---|
| 166 | /PHI \psk@TroisD@Phi\space def |
|---|
| 167 | /Rsphere \psk@TroisD@Radius\space def |
|---|
| 168 | /Dobs \psk@TroisD@Dobs\space def |
|---|
| 169 | /DScreen \psk@TroisD@Ecran\space def |
|---|
| 170 | /xunit {\pst@number\psxunit\space mul}def |
|---|
| 171 | /yunit {\pst@number\psyunit\space mul}def |
|---|
| 172 | /runit {\pst@number\psrunit\space mul}def |
|---|
| 173 | }% |
|---|
| 174 | % |
|---|
| 175 | \newif\ifPst@WorldMap@island |
|---|
| 176 | \define@key[psset]{pst-map3d}{islands}[false]{\@nameuse{Pst@WorldMap@island#1}} |
|---|
| 177 | \psset{islands=true} |
|---|
| 178 | % |
|---|
| 179 | \newif\ifPst@WorldMap@border |
|---|
| 180 | \define@key[psset]{pst-map3d}{borders}[false]{\@nameuse{Pst@WorldMap@border#1}} |
|---|
| 181 | \psset{borders=true} |
|---|
| 182 | % |
|---|
| 183 | \newif\ifPst@WorldMap@france |
|---|
| 184 | \define@key[psset]{pst-map3d}{france}[true]{\@nameuse{Pst@WorldMap@france#1}} |
|---|
| 185 | \psset{france=false} |
|---|
| 186 | % |
|---|
| 187 | \newif\ifPst@WorldMap@capitals |
|---|
| 188 | \define@key[psset]{pst-map3d}{capitals}[true]{\@nameuse{Pst@WorldMap@capitals#1}} |
|---|
| 189 | \psset{capitals=false} |
|---|
| 190 | % |
|---|
| 191 | \newif\ifPst@WorldMap@usa |
|---|
| 192 | \define@key[psset]{pst-map3d}{usa}[true]{\@nameuse{Pst@WorldMap@usa#1}} |
|---|
| 193 | \psset{usa=false} |
|---|
| 194 | % |
|---|
| 195 | \newif\ifPst@WorldMap@mexico |
|---|
| 196 | \define@key[psset]{pst-map3d}{mexico}[true]{\@nameuse{Pst@WorldMap@mexico#1}} |
|---|
| 197 | \psset{mexico=false} |
|---|
| 198 | % |
|---|
| 199 | \newif\ifPst@WorldMap@australia |
|---|
| 200 | \define@key[psset]{pst-map3d}{australia}[true]{\@nameuse{Pst@WorldMap@australia#1}} |
|---|
| 201 | \psset{australia=false} |
|---|
| 202 | % |
|---|
| 203 | \newif\ifPst@WorldMap@canada |
|---|
| 204 | \define@key[psset]{pst-map3d}{canada}[true]{\@nameuse{Pst@WorldMap@canada#1}} |
|---|
| 205 | \psset{canada=false} |
|---|
| 206 | % |
|---|
| 207 | \newif\ifPst@WorldMap@city |
|---|
| 208 | \define@key[psset]{pst-map3d}{citys}[false]{\@nameuse{Pst@WorldMap@city#1}} |
|---|
| 209 | \psset{citys=false} |
|---|
| 210 | % |
|---|
| 211 | \newif\ifPst@WorldMap@Rivers% |
|---|
| 212 | \define@key[psset]{pst-map3d}{rivers}[false]{\@nameuse{Pst@WorldMap@Rivers#1}} |
|---|
| 213 | \psset{rivers=true} |
|---|
| 214 | % |
|---|
| 215 | \newif\ifPst@WorldMap@Lake% |
|---|
| 216 | \define@key[psset]{pst-map3d}{lakes}[false]{\@nameuse{Pst@WorldMap@Lake#1}} |
|---|
| 217 | \psset{lakes=true} |
|---|
| 218 | % |
|---|
| 219 | \newif\ifPst@WorldMap@gridmap |
|---|
| 220 | \define@key[psset]{pst-map3d}{gridmap}[true]{\@nameuse{Pst@WorldMap@gridmap#1}} |
|---|
| 221 | \psset{gridmap=true} |
|---|
| 222 | % |
|---|
| 223 | \newif\ifPst@WorldMap@coasts |
|---|
| 224 | \define@key[psset]{pst-map3d}{coasts}[true]{\@nameuse{Pst@WorldMap@coasts#1}} |
|---|
| 225 | \psset{coasts=false} |
|---|
| 226 | % |
|---|
| 227 | \newif\ifPst@WorldMap@fraczon |
|---|
| 228 | \define@key[psset]{pst-map3d}{wfraczon}[true]{\@nameuse{Pst@WorldMap@fraczon#1}} |
|---|
| 229 | \psset{wfraczon=false} |
|---|
| 230 | % |
|---|
| 231 | \newif\ifPst@WorldMap@ridge |
|---|
| 232 | \define@key[psset]{pst-map3d}{ridge}[true]{\@nameuse{Pst@WorldMap@ridge#1}} |
|---|
| 233 | \psset{ridge=false} |
|---|
| 234 | % |
|---|
| 235 | \newif\ifPst@WorldMap@maglin |
|---|
| 236 | \define@key[psset]{pst-map3d}{wmaglin}[true]{\@nameuse{Pst@WorldMap@maglin#1}} |
|---|
| 237 | \psset{wmaglin=false} |
|---|
| 238 | % |
|---|
| 239 | \newif\ifPst@WorldMap@circles |
|---|
| 240 | \define@key[psset]{pst-map3d}{circles}[false]{\@nameuse{Pst@WorldMap@circles#1}} |
|---|
| 241 | \psset{circles=true} |
|---|
| 242 | % |
|---|
| 243 | \newif\ifPst@WorldMap@visibility |
|---|
| 244 | \define@key[psset]{pst-map3d}{visibility}[false]{\@nameuse{Pst@WorldMap@visibility#1}} |
|---|
| 245 | \psset{visibility=true} |
|---|
| 246 | % |
|---|
| 247 | \newif\ifPst@WorldMap@blueEarth |
|---|
| 248 | \define@key[psset]{pst-map3d}{blueEarth}[false]{\@nameuse{Pst@WorldMap@blueEarth#1}} |
|---|
| 249 | \psset{blueEarth=true} |
|---|
| 250 | % |
|---|
| 251 | \newif\ifPst@WorldMap@ombre |
|---|
| 252 | \define@key[psset]{pst-map3d}{daynight}[true]{\@nameuse{Pst@WorldMap@ombre#1}} |
|---|
| 253 | \psset{daynight=false} |
|---|
| 254 | % |
|---|
| 255 | \def\WorldMapThreeD{\pst@object{WorldMapThreeD}} |
|---|
| 256 | \def\WorldMapThreeD@i{\@ifnextchar[{\WorldMapThreeD@do}{\WorldMapThreeD@do[]}} |
|---|
| 257 | \def\WorldMapThreeD@do[#1]{{% |
|---|
| 258 | \psset{#1}% |
|---|
| 259 | \begin@ClosedObj% |
|---|
| 260 | \addto@pscode{% |
|---|
| 261 | /increment \psk@WorldMap@mapgriddiv\space def |
|---|
| 262 | \variablesTroisD |
|---|
| 263 | /mapcolor {\pst@usecolor\psmapcolor currentrgbcolor} def |
|---|
| 264 | /bordercolor {\pst@usecolor\psbordercolor currentrgbcolor} def |
|---|
| 265 | /coastcolor {\pst@usecolor\pscoastcolor currentrgbcolor} def |
|---|
| 266 | /islandcolor {\pst@usecolor\psislandcolor currentrgbcolor} def |
|---|
| 267 | /maillagecolor {\pst@usecolor\psgridmapcolor currentrgbcolor} def |
|---|
| 268 | /oceancolor {\pst@usecolor\psoceancolor currentrgbcolor} def |
|---|
| 269 | /rivercolor {\pst@usecolor\psrivercolor currentrgbcolor} def |
|---|
| 270 | /wfraczoncolor {\pst@usecolor\pswfraczoncolor currentrgbcolor} def |
|---|
| 271 | /wmaglincolor {\pst@usecolor\pswmaglincolor currentrgbcolor} def |
|---|
| 272 | /ridgecolor {\pst@usecolor\psridgecolor currentrgbcolor} def |
|---|
| 273 | /transfrmcolor {\pst@usecolor\pstransfrmcolor currentrgbcolor} def |
|---|
| 274 | /trenchcolor {\pst@usecolor\pstrenchcolor currentrgbcolor} def |
|---|
| 275 | /circlecolor {\pst@usecolor\pscirclecolor currentrgbcolor} def |
|---|
| 276 | /circlewidth {\pst@number\pscirclewidth SLW} def |
|---|
| 277 | /circlesep \psk@WorldMap@circlesep\space def |
|---|
| 278 | /maillagewidth {\pst@number\psgridmapwidth SLW} def |
|---|
| 279 | /borderwidth {\pst@number\psborderwidth SLW} def |
|---|
| 280 | /coastwidth {\pst@number\pscoastwidth SLW} def |
|---|
| 281 | /wfraczonwidth {\pst@number\pswfraczonwidth SLW} def |
|---|
| 282 | /wmaglinwidth {\pst@number\pswmaglinwidth SLW} def |
|---|
| 283 | /ridgewidth {\pst@number\psridgewidth SLW} def |
|---|
| 284 | /longitude_meridien \psk@WorldMap@longitudeMeridien\space def |
|---|
| 285 | /meridienwidth {\pst@number\psmeridienwidth SLW} def |
|---|
| 286 | /meridiencolor {\pst@usecolor\psmeridiencolor currentrgbcolor} def |
|---|
| 287 | /latitude_parallel \psk@WorldMap@latitudeParallel\space def |
|---|
| 288 | /parallelwidth {\pst@number\psparallelwidth SLW} def |
|---|
| 289 | /parallelcolor {\pst@usecolor\psparallelcolor currentrgbcolor} def |
|---|
| 290 | /year \psk@WorldMap@A\space def |
|---|
| 291 | /month \psk@WorldMap@M\space def |
|---|
| 292 | /day \psk@WorldMap@J\space def |
|---|
| 293 | month 3 lt {/month month 12 add def /year year 1 sub def} if |
|---|
| 294 | /AA year 100 div truncate def |
|---|
| 295 | /BB 2 AA sub AA 4 div truncate add def |
|---|
| 296 | /CC 365.25 year mul truncate def |
|---|
| 297 | /DD 30.6001 month 1 add mul truncate def |
|---|
| 298 | /julien BB CC add DD add day add 1720994.5 add def |
|---|
| 299 | /hour \psk@WorldMap@hour\space def |
|---|
| 300 | /jours julien 2454367 sub def |
|---|
| 301 | /AngleRayonsSoleil latitude_parallel 23.5 sin 360 jours mul 365.25 div sin mul arccos sub def |
|---|
| 302 | /u1 0 def /u2 AngleRayonsSoleil cos def /u3 AngleRayonsSoleil sin def |
|---|
| 303 | % /Julien jd hour 24 div add def |
|---|
| 304 | % |
|---|
| 305 | 1 setlinejoin |
|---|
| 306 | 0 0 translate |
|---|
| 307 | /pst@fill { \psk@opacityalpha .setopacityalpha fill } def |
|---|
| 308 | tx@map3DDict begin |
|---|
| 309 | MatriceTransformationZXY |
|---|
| 310 | % |
|---|
| 311 | /RsphereScreen Rsphere DScreen mul Dobs div |
|---|
| 312 | 1 Rsphere dup mul Dobs dup mul div sub sqrt div runit def |
|---|
| 313 | % |
|---|
| 314 | /GrandCercle { |
|---|
| 315 | % cercle vu par l'observateur |
|---|
| 316 | 0 0 RsphereScreen 0 360 arc |
|---|
| 317 | closepath |
|---|
| 318 | } def |
|---|
| 319 | % |
|---|
| 320 | \ifPst@WorldMap@visibility |
|---|
| 321 | /condition { 0 ge } def |
|---|
| 322 | \else |
|---|
| 323 | /condition { 0 le } def |
|---|
| 324 | \fi |
|---|
| 325 | % |
|---|
| 326 | \ifPst@WorldMap@ombre |
|---|
| 327 | the_night |
|---|
| 328 | \fi |
|---|
| 329 | % |
|---|
| 330 | \ifPst@WorldMap@blueEarth |
|---|
| 331 | gsave |
|---|
| 332 | newpath |
|---|
| 333 | oceancolor |
|---|
| 334 | GrandCercle |
|---|
| 335 | pst@fill % fill |
|---|
| 336 | grestore |
|---|
| 337 | \fi |
|---|
| 338 | % |
|---|
| 339 | \ifPst@WorldMap@circles |
|---|
| 340 | gsave |
|---|
| 341 | oceans_seas_hatched |
|---|
| 342 | grestore |
|---|
| 343 | \fi |
|---|
| 344 | % |
|---|
| 345 | \ifPst@WorldMap@border |
|---|
| 346 | (\psk@WorldMap@Path/pborder.dat) run |
|---|
| 347 | gsave |
|---|
| 348 | GrandCercle |
|---|
| 349 | clip |
|---|
| 350 | border dup /REGION exch def |
|---|
| 351 | CompteurRegions |
|---|
| 352 | {CalculsPointsRegion |
|---|
| 353 | closepath |
|---|
| 354 | gsave |
|---|
| 355 | mapcolor |
|---|
| 356 | pst@fill % fill |
|---|
| 357 | grestore |
|---|
| 358 | borderwidth |
|---|
| 359 | bordercolor |
|---|
| 360 | stroke |
|---|
| 361 | }forall |
|---|
| 362 | grestore |
|---|
| 363 | \fi |
|---|
| 364 | % |
|---|
| 365 | \ifPst@WorldMap@island |
|---|
| 366 | (\psk@WorldMap@Path/pisland.dat) run |
|---|
| 367 | gsave |
|---|
| 368 | GrandCercle |
|---|
| 369 | clip |
|---|
| 370 | islands dup /REGION exch def |
|---|
| 371 | CompteurRegions |
|---|
| 372 | {CalculsPointsRegion |
|---|
| 373 | closepath |
|---|
| 374 | gsave |
|---|
| 375 | mapcolor |
|---|
| 376 | pst@fill % fill |
|---|
| 377 | grestore |
|---|
| 378 | borderwidth |
|---|
| 379 | islandcolor |
|---|
| 380 | stroke |
|---|
| 381 | }forall |
|---|
| 382 | grestore |
|---|
| 383 | \fi |
|---|
| 384 | % |
|---|
| 385 | \ifPst@WorldMap@france |
|---|
| 386 | (\psk@WorldMap@Path/france.dat) run |
|---|
| 387 | gsave |
|---|
| 388 | GrandCercle |
|---|
| 389 | clip |
|---|
| 390 | france dup /REGION exch def |
|---|
| 391 | CompteurRegions |
|---|
| 392 | {CalculsPointsRegion |
|---|
| 393 | closepath |
|---|
| 394 | gsave |
|---|
| 395 | mapcolor |
|---|
| 396 | pst@fill % fill |
|---|
| 397 | grestore |
|---|
| 398 | borderwidth |
|---|
| 399 | bordercolor |
|---|
| 400 | stroke |
|---|
| 401 | }forall |
|---|
| 402 | grestore |
|---|
| 403 | \fi |
|---|
| 404 | % |
|---|
| 405 | \ifPst@WorldMap@Lake |
|---|
| 406 | (\psk@WorldMap@Path/plake.dat) run |
|---|
| 407 | gsave |
|---|
| 408 | GrandCercle |
|---|
| 409 | clip |
|---|
| 410 | lake dup /REGION exch def |
|---|
| 411 | CompteurRegions |
|---|
| 412 | {CalculsPointsRegion |
|---|
| 413 | closepath |
|---|
| 414 | gsave |
|---|
| 415 | oceancolor |
|---|
| 416 | pst@fill % fill |
|---|
| 417 | grestore |
|---|
| 418 | % borderwidth |
|---|
| 419 | % bordercolor |
|---|
| 420 | 0 0 1 setrgbcolor |
|---|
| 421 | stroke |
|---|
| 422 | }forall |
|---|
| 423 | grestore |
|---|
| 424 | \fi |
|---|
| 425 | % |
|---|
| 426 | \ifPst@WorldMap@coasts |
|---|
| 427 | (\psk@WorldMap@Path/pcoast.dat) run |
|---|
| 428 | gsave |
|---|
| 429 | GrandCercle |
|---|
| 430 | clip |
|---|
| 431 | coasts dup /REGION exch def |
|---|
| 432 | CompteurRegions |
|---|
| 433 | {CalculsPointsRegion |
|---|
| 434 | coastwidth |
|---|
| 435 | coastcolor |
|---|
| 436 | stroke |
|---|
| 437 | }forall |
|---|
| 438 | grestore |
|---|
| 439 | \fi |
|---|
| 440 | % |
|---|
| 441 | \ifPst@WorldMap@usa |
|---|
| 442 | (\psk@WorldMap@Path/usa.dat) run |
|---|
| 443 | gsave |
|---|
| 444 | GrandCercle |
|---|
| 445 | clip |
|---|
| 446 | usa dup /REGION exch def |
|---|
| 447 | CompteurRegions |
|---|
| 448 | {CalculsPointsRegion |
|---|
| 449 | borderwidth |
|---|
| 450 | bordercolor |
|---|
| 451 | stroke |
|---|
| 452 | }forall |
|---|
| 453 | grestore |
|---|
| 454 | \fi |
|---|
| 455 | % |
|---|
| 456 | \ifPst@WorldMap@mexico |
|---|
| 457 | (\psk@WorldMap@Path/mex.dat) run |
|---|
| 458 | gsave |
|---|
| 459 | GrandCercle |
|---|
| 460 | clip |
|---|
| 461 | mexico dup /REGION exch def |
|---|
| 462 | CompteurRegions |
|---|
| 463 | {CalculsPointsRegion |
|---|
| 464 | borderwidth |
|---|
| 465 | bordercolor |
|---|
| 466 | stroke |
|---|
| 467 | }forall |
|---|
| 468 | grestore |
|---|
| 469 | \fi |
|---|
| 470 | % |
|---|
| 471 | \ifPst@WorldMap@australia |
|---|
| 472 | (\psk@WorldMap@Path/aus.dat) run |
|---|
| 473 | gsave |
|---|
| 474 | GrandCercle |
|---|
| 475 | clip |
|---|
| 476 | australia dup /REGION exch def |
|---|
| 477 | CompteurRegions |
|---|
| 478 | {CalculsPointsRegion |
|---|
| 479 | borderwidth |
|---|
| 480 | bordercolor |
|---|
| 481 | stroke |
|---|
| 482 | }forall |
|---|
| 483 | grestore |
|---|
| 484 | \fi |
|---|
| 485 | % |
|---|
| 486 | \ifPst@WorldMap@canada |
|---|
| 487 | (\psk@WorldMap@Path/canada.dat) run |
|---|
| 488 | gsave |
|---|
| 489 | GrandCercle |
|---|
| 490 | clip |
|---|
| 491 | canada dup /REGION exch def |
|---|
| 492 | CompteurRegions |
|---|
| 493 | {CalculsPointsRegion |
|---|
| 494 | borderwidth |
|---|
| 495 | bordercolor |
|---|
| 496 | stroke |
|---|
| 497 | }forall |
|---|
| 498 | grestore |
|---|
| 499 | \fi |
|---|
| 500 | % |
|---|
| 501 | \ifPst@WorldMap@fraczon |
|---|
| 502 | (\psk@WorldMap@Path/wfraczon.dat) run |
|---|
| 503 | GrandCercle |
|---|
| 504 | clip |
|---|
| 505 | wfraczon dup /REGION exch def |
|---|
| 506 | CompteurRegions |
|---|
| 507 | {CalculsPointsRegion |
|---|
| 508 | wfraczoncolor |
|---|
| 509 | wfraczonwidth |
|---|
| 510 | stroke}forall |
|---|
| 511 | \fi |
|---|
| 512 | % |
|---|
| 513 | \ifPst@WorldMap@maglin |
|---|
| 514 | (\psk@WorldMap@Path/wmaglin.dat) run |
|---|
| 515 | GrandCercle |
|---|
| 516 | clip |
|---|
| 517 | wmaglin dup /REGION exch def |
|---|
| 518 | CompteurRegions |
|---|
| 519 | {CalculsPointsRegion |
|---|
| 520 | wmaglincolor |
|---|
| 521 | wmaglinwidth |
|---|
| 522 | stroke}forall |
|---|
| 523 | \fi |
|---|
| 524 | % |
|---|
| 525 | \ifPst@WorldMap@ridge |
|---|
| 526 | (\psk@WorldMap@Path/ridge.dat) run |
|---|
| 527 | gsave |
|---|
| 528 | GrandCercle |
|---|
| 529 | clip |
|---|
| 530 | ridge dup /REGION exch def |
|---|
| 531 | CompteurRegions |
|---|
| 532 | {CalculsPointsRegion |
|---|
| 533 | ridgecolor |
|---|
| 534 | ridgewidth |
|---|
| 535 | stroke}forall |
|---|
| 536 | grestore |
|---|
| 537 | (\psk@WorldMap@Path/transfrm.dat) run |
|---|
| 538 | gsave |
|---|
| 539 | GrandCercle |
|---|
| 540 | clip |
|---|
| 541 | transfrm dup /REGION exch def |
|---|
| 542 | CompteurRegions |
|---|
| 543 | {CalculsPointsRegion |
|---|
| 544 | transfrmcolor |
|---|
| 545 | ridgewidth |
|---|
| 546 | stroke}forall |
|---|
| 547 | grestore |
|---|
| 548 | (\psk@WorldMap@Path/trench.dat) run |
|---|
| 549 | gsave |
|---|
| 550 | GrandCercle |
|---|
| 551 | clip |
|---|
| 552 | trench dup /REGION exch def |
|---|
| 553 | CompteurRegions |
|---|
| 554 | {CalculsPointsRegion |
|---|
| 555 | trenchcolor |
|---|
| 556 | ridgewidth |
|---|
| 557 | stroke}forall |
|---|
| 558 | grestore |
|---|
| 559 | \fi |
|---|
| 560 | % |
|---|
| 561 | \ifPst@WorldMap@Rivers |
|---|
| 562 | (\psk@WorldMap@Path/river.dat) run |
|---|
| 563 | GrandCercle |
|---|
| 564 | clip |
|---|
| 565 | river dup /REGION exch def |
|---|
| 566 | CompteurRegions |
|---|
| 567 | {CalculsPointsRegion |
|---|
| 568 | rivercolor |
|---|
| 569 | stroke}forall |
|---|
| 570 | \fi |
|---|
| 571 | % |
|---|
| 572 | \ifPst@WorldMap@city |
|---|
| 573 | % les capitales |
|---|
| 574 | (\psk@WorldMap@Path/c-cap.dat) run |
|---|
| 575 | 1.5 |
|---|
| 576 | citycapitals |
|---|
| 577 | DrawCitys |
|---|
| 578 | % les autres villes |
|---|
| 579 | (\psk@WorldMap@Path/c-sub.dat) run |
|---|
| 580 | 0.5 |
|---|
| 581 | CitySub |
|---|
| 582 | DrawCitys |
|---|
| 583 | \fi |
|---|
| 584 | \ifPst@WorldMap@capitals |
|---|
| 585 | % les capitales |
|---|
| 586 | (\psk@WorldMap@Path/c-cap.dat) run |
|---|
| 587 | 2 |
|---|
| 588 | citycapitals |
|---|
| 589 | DrawCitys |
|---|
| 590 | \fi |
|---|
| 591 | % |
|---|
| 592 | \ifPst@WorldMap@gridmap |
|---|
| 593 | MaillageSphere |
|---|
| 594 | \fi |
|---|
| 595 | end}% |
|---|
| 596 | \end@ClosedObj}} |
|---|
| 597 | % placer une ville en particulier |
|---|
| 598 | % par sa longitude et sa latitude en degrés |
|---|
| 599 | % si la ville n'est pas visible |
|---|
| 600 | % elle est rejetée hors de l'écran |
|---|
| 601 | \def\pnodeMapIIID{\pst@object{pnodeMapIIID}} |
|---|
| 602 | \def\pnodeMapIIID@i(#1,#2)#3{% |
|---|
| 603 | \begin@SpecialObj% |
|---|
| 604 | \pnode( ! |
|---|
| 605 | \variablesTroisD |
|---|
| 606 | tx@map3DDict begin |
|---|
| 607 | MatriceTransformationZXY |
|---|
| 608 | /Xpoint {#2 cos #1 cos mul Rsphere mul} def |
|---|
| 609 | /Ypoint {#2 cos #1 sin mul Rsphere mul} def |
|---|
| 610 | /Zpoint {#2 sin Rsphere mul } def |
|---|
| 611 | CalculsPointsAfterTransformations |
|---|
| 612 | % CalcCoordinates |
|---|
| 613 | % /YcoorCity exch def /XcoorCity exch def |
|---|
| 614 | % Test |
|---|
| 615 | % PS 0 ge % |
|---|
| 616 | % {XcoorCity YcoorCity } |
|---|
| 617 | % {/XcoorCity 1000 def /YcoorCity 1000 def} |
|---|
| 618 | % ifelse |
|---|
| 619 | formulesTroisD |
|---|
| 620 | Xi Yi end){#3}% |
|---|
| 621 | \end@SpecialObj% |
|---|
| 622 | \ignorespaces}% |
|---|
| 623 | % |
|---|
| 624 | % adaptation de \mapput de \pst-map2d} |
|---|
| 625 | \define@key[psset]{pst-map3d}{mapCountry}{\edef\psk@WorldMap@mapCountry{#1}} |
|---|
| 626 | \psset{mapCountry=all} |
|---|
| 627 | \define@key[psset]{pst-map3d}{nodeWidth}{\edef\psk@WorldMap@nodeWidth{#1}} |
|---|
| 628 | \psset{nodeWidth=1mm} |
|---|
| 629 | \newpsstyle{psNodeMapStyle}{fillstyle=solid,fillcolor=red} |
|---|
| 630 | \newpsstyle{NodeLabelStyle}{fillstyle=solid,fillcolor=yellow,framesep=0,linestyle=none} |
|---|
| 631 | |
|---|
| 632 | % |
|---|
| 633 | \def\mapputIIID{\@ifnextchar[{\mapputIIID@i}{\mapputIIID@i[90]}} |
|---|
| 634 | \def\mapputIIID@i[#1](#2,#3){\@ifnextchar[{\mapputIIID@iii[#1](#2,#3)}{\mapputIIID@ii[#1](#2,#3)}} |
|---|
| 635 | \def\mapputIIID@ii[#1](#2,#3)#4{\mapputIIID@iii[#1](#2,#3)[#4]{#4}} |
|---|
| 636 | \def\mapputIIID@iii[#1](#2,#3)[#4]#5{% |
|---|
| 637 | \@ifnextchar[{\mapputIIID@iv[#1](#2,#3)[#4]#5}{\mapputIIID@iv[#1](#2,#3)[#4]#5[\@empty]}} |
|---|
| 638 | \def\mapputIIID@iv[#1](#2,#3)[#4]#5[#6]{{% |
|---|
| 639 | % [angle](longitude,lattitude)[node name]{node label}[country] |
|---|
| 640 | \def\pst@tempb{all} |
|---|
| 641 | \ifx\pst@tempb\psk@WorldMap@mapCountry |
|---|
| 642 | \mapputIIID@v[#1](#2,#3)[#4]{#5}% |
|---|
| 643 | \else |
|---|
| 644 | \def\pst@tempb{#6}% |
|---|
| 645 | % \typeout{Compare \pst@tempb{} with \psk@WorldMap@mapCountry} |
|---|
| 646 | \ifx\pst@tempb\psk@WorldMap@mapCountry |
|---|
| 647 | \mapputIIID@v[#1](#2,#3)[#4]{#5} |
|---|
| 648 | \fi% |
|---|
| 649 | \fi% |
|---|
| 650 | }} |
|---|
| 651 | \def\mapputIIID@v[#1](#2,#3)[#4]#5{{% |
|---|
| 652 | \pnodeMapIIID(#2,#3){#4} |
|---|
| 653 | % \typeout{Node: #4} |
|---|
| 654 | \pst@dima=\psk@WorldMap@nodeWidth |
|---|
| 655 | \pscircle[style=psNodeMapStyle](#4){\pst@dima} |
|---|
| 656 | \pscircle*(#4){0.5\pst@dima} |
|---|
| 657 | \uput{1.2\pst@dima}[#1](#4){\psframebox[style=NodeLabelStyle]{\sf#5}}% |
|---|
| 658 | }} |
|---|
| 659 | % |
|---|
| 660 | % dessiner un méridien de longitude donnée |
|---|
| 661 | % longitude en degrés |
|---|
| 662 | \def\psmeridien{\pst@object{psmeridien}} |
|---|
| 663 | \def\psmeridien@i#1{% |
|---|
| 664 | \pst@killglue |
|---|
| 665 | \begingroup |
|---|
| 666 | \begin@SpecialObj% |
|---|
| 667 | \addto@pscode{% |
|---|
| 668 | \variablesTroisD |
|---|
| 669 | /longitude_meridien #1 def |
|---|
| 670 | /meridienwidth {\pst@number\psmeridienwidth SLW} def |
|---|
| 671 | /meridiencolor {\pst@usecolor\psmeridiencolor currentrgbcolor} def |
|---|
| 672 | tx@map3DDict begin |
|---|
| 673 | MatriceTransformationZXY |
|---|
| 674 | \ifPst@WorldMap@visibility |
|---|
| 675 | /condition { 0 ge } def |
|---|
| 676 | \else |
|---|
| 677 | /condition { 0 le } def |
|---|
| 678 | \fi |
|---|
| 679 | meridien |
|---|
| 680 | end}% |
|---|
| 681 | \end@SpecialObj% |
|---|
| 682 | \endgroup% |
|---|
| 683 | \ignorespaces% |
|---|
| 684 | } |
|---|
| 685 | % |
|---|
| 686 | % dessiner un cercle parallèle à l'équateur de latitude donnée |
|---|
| 687 | % latitude en degrés |
|---|
| 688 | \def\psparallel{\pst@object{psparallel}} |
|---|
| 689 | \def\psparallel@i#1{% |
|---|
| 690 | \pst@killglue |
|---|
| 691 | \begingroup |
|---|
| 692 | \begin@SpecialObj% |
|---|
| 693 | \addto@pscode{% |
|---|
| 694 | \variablesTroisD |
|---|
| 695 | /latitude_parallel #1 def |
|---|
| 696 | /parallelwidth {\pst@number\psparallelwidth SLW} def |
|---|
| 697 | /parallelcolor {\pst@usecolor\psparallelcolor currentrgbcolor} def |
|---|
| 698 | tx@map3DDict begin |
|---|
| 699 | MatriceTransformationZXY |
|---|
| 700 | \ifPst@WorldMap@visibility |
|---|
| 701 | /condition { 0 ge } def |
|---|
| 702 | \else |
|---|
| 703 | /condition { 0 le } def |
|---|
| 704 | \fi |
|---|
| 705 | Parallel |
|---|
| 706 | parallelwidth |
|---|
| 707 | parallelcolor |
|---|
| 708 | stroke |
|---|
| 709 | end}% |
|---|
| 710 | \end@SpecialObj% |
|---|
| 711 | \endgroup% |
|---|
| 712 | \ignorespaces% |
|---|
| 713 | } |
|---|
| 714 | %%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 715 | % le dessin du globe tellure |
|---|
| 716 | %%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 717 | |
|---|
| 718 | \define@key[psset]{pst-map3d}{styleGlobe}{% style du globe |
|---|
| 719 | \edef\psk@styleGlobe{#1}} |
|---|
| 720 | |
|---|
| 721 | \define@key[psset]{pst-map3d}{styleNight}{% style de la partie dans la nuit |
|---|
| 722 | \edef\psk@styleNight{#1}} |
|---|
| 723 | |
|---|
| 724 | \newpsstyle{Globe}{circles=true} |
|---|
| 725 | \newpsstyle{night}{fillstyle=solid,fillcolor=black,opacity=0.8} |
|---|
| 726 | \psset[pst-map3d]{styleGlobe=Globe,styleNight=night} |
|---|
| 727 | |
|---|
| 728 | \def\psGlobeTellure{\pst@object{psGlobeTellure}} |
|---|
| 729 | \def\psGlobeTellure@i(#1,#2)#3{% longitude, latitude et nom de la ville |
|---|
| 730 | \begin@SpecialObj% |
|---|
| 731 | \pnode(!/ux 0 def /uy 90 #2 sub sin def /uz 90 #2 sub cos def 0 0){ttt}% |
|---|
| 732 | \psset{THETA=0,PHI=0}% |
|---|
| 733 | {\psset{RotX=#2 90 sub,RotZ=90 #1 add} |
|---|
| 734 | \WorldMapThreeD[style=\psk@styleGlobe,daynight=false]% |
|---|
| 735 | \mapputIIID(#1,#2){#3}}% |
|---|
| 736 | \WorldMapThreeD[style=\psk@styleNight,daynight=true,circles=false,blueEarth=false, |
|---|
| 737 | borders=false,islands=false, |
|---|
| 738 | rivers=false,lakes=false, |
|---|
| 739 | gridmap=false,latitudeParallel=#2]% |
|---|
| 740 | \psframe*(! -3 \psk@TroisD@Radius\space neg -1.5 add)(!3 \psk@TroisD@Radius\space neg -0.5 add) |
|---|
| 741 | \rput(! 0 \psk@TroisD@Radius\space neg -1 add){\white\psk@WorldMap@hour h le \psk@WorldMap@J/\psk@WorldMap@M/\psk@WorldMap@A} |
|---|
| 742 | \end@SpecialObj% |
|---|
| 743 | \ignorespaces}% |
|---|
| 744 | |
|---|
| 745 | %%%%%%%%%%%%%%%%%%%%%%%%% |
|---|
| 746 | |
|---|
| 747 | % épicentre d'un tremblement de terre |
|---|
| 748 | % Earthquake Epicenters |
|---|
| 749 | % |
|---|
| 750 | \define@key[psset]{pst-map3d}{waves}{\edef\psk@WorldMap@waves{#1}} |
|---|
| 751 | \psset{waves=3} % nombre de cercles concentriques |
|---|
| 752 | \define@key[psset]{pst-map3d}{Rmax}{\edef\psk@WorldMap@Rmax{#1}} |
|---|
| 753 | \psset{Rmax=1500} % rayon maximum du séisme en km |
|---|
| 754 | |
|---|
| 755 | \def\psepicenter{\pst@object{psepicenter}} |
|---|
| 756 | \def\psepicenter@i(#1,#2)#3{% |
|---|
| 757 | \begin@SpecialObj% |
|---|
| 758 | \addto@pscode{% |
|---|
| 759 | \variablesTroisD |
|---|
| 760 | /longitude #1 def |
|---|
| 761 | /latitude #2 def |
|---|
| 762 | /nbre \psk@WorldMap@waves\space def |
|---|
| 763 | /dphi \psk@WorldMap@Rmax\space 0.008983 mul def |
|---|
| 764 | /circlecolor {\pst@usecolor\pscirclecolor currentrgbcolor} def |
|---|
| 765 | /circlewidth {\pst@number\pscirclewidth SLW} def |
|---|
| 766 | tx@map3DDict begin |
|---|
| 767 | circlecolor |
|---|
| 768 | circlewidth |
|---|
| 769 | nbre dphi longitude latitude |
|---|
| 770 | ondes |
|---|
| 771 | end}% |
|---|
| 772 | \mapputIIID(#1,#2){#3} |
|---|
| 773 | \end@SpecialObj% |
|---|
| 774 | \ignorespaces% |
|---|
| 775 | } |
|---|
| 776 | \catcode`\@=\PstAtCode\relax |
|---|
| 777 | \endinput |
|---|