blob: f2613405cf33d6080300784336745723b656755b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
|
%%
%% This is file `pst-map3d.tex',
%%
%% IMPORTANT NOTICE:
%%
%% Package `pst-map3d.tex'
%%
%% Manuel Luque <Mluque5130@aol.com> (France)
%% Giuseppe Matarazzo <joematara@hotmail.com> (Italy)
%% Herbert Voss <voss _at_ perce.de> (Germany)
%%
%% May 09, 2004
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN archives
%% in directory macros/latex/base/lppl.txt.
%%
%% DESCRIPTION:
%% `pst-map3d' is a PSTricks package to create geographical objects
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\csname PSTMapThreeD\endcsname
\let\PSTMapThreeDLoaded\endinput
% Require PSTricks
\ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi
\ifx\PSTnodesLoaded\endinput\else\input pst-node.tex\fi % hv 2004-05-09
\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey.tex \fi
\def\fileversion{1.03}
\def\filedate{2005/11/10}
\message{`PST-map3d v\fileversion, \filedate\space (ML/GM/HV)}
\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
\pst@addfams{pst-map3d}
%
\SpecialCoor
%
\define@key[psset]{pst-map3d}{path}{\edef\psk@WorldMap@Path{#1}} % chemin des données
\psset{path=data}
%
\pstheader{map3d.pro}
\define@key[psset]{pst-map3d}{RotX}{\edef\psk@TroisD@RotX{#1}} % rotation autour de Ox en degrés
\define@key[psset]{pst-map3d}{RotY}{\edef\psk@TroisD@RotY{#1}} % rotation autour de Oy en degrés
\define@key[psset]{pst-map3d}{RotZ}{\edef\psk@TroisD@RotZ{#1}} % rotation autour de OZ en degrés
\define@key[psset]{pst-map3d}{Radius}{\edef\psk@TroisD@Radius{#1}} % rayon de la sphère
%
\define@key[psset]{pst-map3d}{THETA}{\edef\psk@TroisD@Theta{#1}}
\define@key[psset]{pst-map3d}{PHI}{\edef\psk@TroisD@Phi{#1}}
\define@key[psset]{pst-map3d}{Dobs}{\edef\psk@TroisD@Dobs{#1}}
\define@key[psset]{pst-map3d}{Decran}{\edef\psk@TroisD@Ecran{#1}}
\psset{THETA=0,PHI=45,Dobs=20,Decran=25}
%
\psset{RotX=0,RotY=0,RotZ=0,Radius=5}
%
\define@key[psset]{pst-map3d}{increment}{\edef\psk@WorldMap@increment{#1}}
\psset{increment=10}
%
\define@key[psset]{pst-map3d}{maillageColor}{\edef\psk@WorldMap@maillageColor{#1}}
\psset{maillageColor= 0.5 0.5 0.5 }
%
\define@key[psset]{pst-map3d}{MapFillColor}{\edef\psk@WorldMap@Fillcolor{#1}} % couleur des continents
\psset{MapFillColor= 0.99 0.95 0.7 }
%
\define@key[psset]{pst-map3d}{level}{\edef\psk@WorldMap@level{#1}}
\psset{level=1}
%
\def\variablesTroisD{%
/RotX \psk@TroisD@RotX\space def
/RotY \psk@TroisD@RotY\space def
/RotZ \psk@TroisD@RotZ\space def
/THETA \psk@TroisD@Theta\space def
/PHI \psk@TroisD@Phi\space def
/Rsphere \psk@TroisD@Radius\space def
/Dobs \psk@TroisD@Dobs\space def
/DScreen \psk@TroisD@Ecran\space def
/step \psk@WorldMap@level\space def
}%
%
\newif\ifPst@WorldMap@capitals
\define@key[psset]{pst-map3d}{capital}[false]{\@nameuse{Pst@WorldMap@capitals#1}}
\psset{capital=false}
%
\newif\ifPst@WorldMap@city
\define@key[psset]{pst-map3d}{city}[false]{\@nameuse{Pst@WorldMap@city#1}}
\psset{city=false}
%
\newif\ifPst@WorldMap@Rivers% hv 2004-05-03
\define@key[psset]{pst-map3d}{rivers}[true]{\@nameuse{Pst@WorldMap@Rivers#1}}
\psset{rivers=true}
%
\newif\ifPst@WorldMap@maillage
\define@key[psset]{pst-map3d}{maillage}[true]{\@nameuse{Pst@WorldMap@maillage#1}}
\psset{maillage=true}
%
\def\WorldMapThreeD{\pst@object{WorldMapThreeD}}
\def\WorldMapThreeD@i{\@ifnextchar[{\WorldMapThreeD@do}{\WorldMapThreeD@do[]}}
\def\WorldMapThreeD@do[#1]{{%
\psset{#1}%
\begin@ClosedObj
\addto@pscode{%
/increment \psk@WorldMap@increment\space def
\variablesTroisD
(\psk@WorldMap@Path/river.dat) run
(\psk@WorldMap@Path/pisland.dat) run
(\psk@WorldMap@Path/pborder.dat) run
(\psk@WorldMap@Path/plake.dat) run
1 setlinejoin
0 0 translate
/xunit {\pst@number\psxunit\space mul}def
/yunit {\pst@number\psyunit\space mul}def
/runit {\pst@number\psrunit\space mul}def
gsave
newpath
0.5 0.8 0.8 setrgbcolor
% cercle vu par l'observateur
/RsphereScreen Rsphere DScreen mul Dobs div
1 Rsphere dup mul Dobs dup mul div sub sqrt div runit def
0 0 RsphereScreen 0 360 arc
closepath
fill
grestore
/condition {PSfacette 0 le} def
/departPhi -90 def
tx@map3DDict begin
MatriceTransformation
/Draw {
{
CalculsPoints
closepath
gsave
Color setrgbcolor
fill
grestore
stroke
} forall
}def
%/Color {0.5 0.8 0.5} def
/Color {\psk@WorldMap@Fillcolor} def
border
Draw
islands
Draw
/Color {0.5 0.8 0.8} def
lake
Draw
% les rivières
\ifPst@WorldMap@Rivers % hv 2004-05-03
/DrawRivers {
{ CalculsPoints
0 0 1 setrgbcolor
stroke
} forall
}def
river
DrawRivers
\fi
\ifPst@WorldMap@city
% les capitales
(\psk@WorldMap@Path/c-cap.dat) run
1.5
citycapitals
DrawCitys
% les autres villes
(\psk@WorldMap@Path/c-sub.dat) run
0.5
CitySub
DrawCitys
\fi
\ifPst@WorldMap@capitals
% les capitales
(\psk@WorldMap@Path/c-cap.dat) run
2
citycapitals
DrawCitys
\fi
\ifPst@WorldMap@maillage
/maillageColor {\psk@WorldMap@maillageColor} def
MaillageSphere
\fi
end}%
\end@ClosedObj
}}
%
\catcode`\@=\PstAtCode\relax
\endinput
|