summaryrefslogtreecommitdiff
path: root/graphics/epix/doc/ePiX.xp
blob: c39e6b2ac0286c135330e5a96a3a07d934b26560 (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
/* -*-ePiX-*- */
#include "epix.h"
using namespace ePiX;

void emph(const std::string& prog)
{
  if (prog == "all")
    black();
  else
    {
      bbold(Red());
      label_color(Blue());
      label_mask(Yellow(0.1));
      label_border(Red(), "0.1pt");
    }
}

void restore(const std::string& prog)
{
  if (prog == "all")
    emph(prog);

  else
    {
      plain();
      black(0.5);
      label_mask(Neutral());
    }
}

void diagram(const std::string& prog)
{
  font_size("footnotesize");
  arrow_width(1.5);
  restore(prog);

  if (prog != "laps")
    emph(prog);

  arrow(P(0,1), P(1,1));

  dot(P(0,1), P(0,4), "\\texttt{xp}, \\texttt{flx}", t);
  dot(P(1,1), P(2,4), "\\texttt{eepic}", t);
  restore(prog);

  if (prog != "epix")
    emph(prog);

  spline(P(1,1), P(1.2,1), P(1.3,0.5), P(1.5,0.5));
  arrow(P(1.5,0.5), P(2,0.5));
  arrow(P(2,0.5), P(3,0.5));

  dot(P(2,0.5), P(0,4), "\\texttt{dvi}", t);
  dot(P(3,0.5), P(-2,2), "\\texttt{ps}", tl);
  restore(prog);

  if(prog == "laps")
    emph(prog);

  spline(P(1,0), P(1.2,0), P(1.3,0.5), P(1.5,0.5));

  dot(P(1,0), P(2,-4), "\\texttt{tex}", b);

  if (prog == "elaps") // and laps
    emph(prog);

  arrow(P(3,0.5), P(3.5,0), P(4,0));

  dot(P(4,0), P(4,0), "\\texttt{pdf}", r);
  restore(prog);

  if (prog == "elaps" || prog == "flix")
    emph(prog);

  arrow(P(3,0.5), P(3.5,1), P(4,1));

  dot(P(4,1), P(-2,4), "\\texttt{eps}", t);
  restore(prog);

  if(prog == "flix")
    emph(prog);

  arrow(P(4,1), P(5,1));

  dot(P(5,1), P(4,0),
      "\\begin{minipage}{0.225in}\\texttt{png mng gif}\\end{minipage}", r);
  restore(prog);

  if (prog != "all")
    {
      font_size("Large");
      font_face("tt");
      label_color(Green(0.6));
      label(P(2.5,0), prog);
    }

}

int main()
{
#ifdef SHOW_ALL
  picture(P(-0.5,0), P(5.75,10), "4 x 7.5 in");
#else
  picture(P(-0.5,2), P(5.75,10), "4 x 7.5 in");
#endif

  begin();
  //  border();

  screen laps(P(0,0), P(5,1));
  activate(laps);

  diagram("laps");
  laps.v_scale(0.5, P(0,0.5));
  inset(laps, P(0,8), P(5,10));
  deactivate(laps);


  screen epix(P(0,0), P(5,1));
  activate(epix);

  diagram("epix");
  epix.v_scale(0.5, P(0,0.5));
  inset(epix, P(0,6), P(5,8));
  deactivate(epix);


  screen elaps(P(0,0), P(5,1));
  activate(elaps);

  diagram("elaps");
  elaps.v_scale(0.5, P(0,0.5));
  inset(elaps, P(0,4), P(5,6));
  deactivate(elaps);


  screen flix(P(0,0), P(5,1));
  activate(flix);

  diagram("flix");
  flix.v_scale(0.5, P(0,0.5));
  inset(flix, P(0,2), P(5,4));
  deactivate(flix);

#ifdef SHOW_ALL
  screen all(P(0,0), P(5,1));
  activate(all);

  diagram("all");
  all.v_scale(0.5, P(0,0.5));
  inset(all, P(0,0), P(5,2));
  deactivate(all);
#endif

  end();
}