aboutsummaryrefslogtreecommitdiff
path: root/src/graph/Gdraws/Makefile.pamphlet
blob: 40b013c68b57bfa7eafe4f7e11133fecca42bcea (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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
%% Oh Emacs, this is a -*- Makefile -*-, so give me tabs.
\documentclass{article}
\usepackage{axiom}

\title{\$SPAD/src/graph/Gdraws Makefile}
\author{Timothy Daly \and Gabriel Dos~Reis}

\begin{document}
\maketitle

\begin{abstract}
\end{abstract}
\eject

\tableofcontents
\eject

\section{Gdraws}

This directory consists of all the Gdraw functions along with a local
testing protocol to test out these functions.
The subdirectory PS contains all the ps drawing functions in support of
the Gdraw functions.

\subsection{GDRAW}

A Gdraw function, using a draw option dFlsg as input, provides drawings
capability on different output devices.  Currently, Gdraw supports routines
both in Xwindows functions, and in postscript functions on
a postscript printer/interpreter.

The general drawing functions are (see file for description of functionality)
\begin{verbatim}
 1.  Gdrawarc.c
 2.  Gdrawstring.c
 3.  Gdraw.c
 4.  Gdrawline.c
 5.  Gdrfilled.c
 6.  GdrawFrame.c
 7.  Gdrawlines.c
 8.  Gfillarc.c
 9.  GdrawIstr.c
 10. Gdrawrect.c
 11. Gmisc.c
 12. GinitPS.c
 13. GCreatePS.c
 14. PSFill.c
 15. ../include/G.h
    header information needed by all the Gdraw routines and
    view3D/view2D as well.
 16. ps.h
    header information needed by only the Gdraw routines.

\subsection{POSTSCRIPT}

A PostScript file can be generated by using a button on the control
panel of a viewAlone picture, or in Axiom, with the command write,
option Postscript.  This file can be submitted to the postsctipt
printer to be printed, or viewed using the postscript interpreter.  
It will draw a window, title, and picture clipped to fit inside of the
window.

In order to generate a postscript output, we first initializ file names and
paths to be used by our program by using
\begin{verbatim}
	InitPs(viewWindow, titleWindow)    [in GinitPS.c]
\end{verbatim}
then call the G draw routines with option "PS", which would generate postscript
drawing commands.  Then create the output file (OUTPUT.ps by default) by using
\begin{verbatim}
	makePSfile(viewWindow, titleWindow, title)   [in GcreatePS.c]
\end{verbatim}

The output file would be in local directory, i.e., the directory where Axiom
or viewAlone, etc., was started up.

The following routines are used to test out the Gdraw functions:
\begin{verbatim}
1.  main.c      creates windows, and titles and processes Xwindow events.
2.  data.c      creates data for drawing and call Gdraw routines.
3.  menu.c      draws menu when mouse clicks in viewWindow
4.  yesORno.c   determines if mouse click in menu means "yes" or "no".
5.  loadFont.c 	loads font for display
\end{verbatim}

The Gdraw routines have been written in such a way that they are usable by
both view3D and view2D.  

\subsection{TO USE G FUNCTIONS}

In order to draw in postscript, use GSetForeground to set the foreground 
colors for the drawing (and fill) functions.  Use GSetLineAttributes
to set line attributes.  And finally, replace the XDraw commands with the
corresponding GDraw commands with the appropriate parameters.  In addition,
we need to: draw frame, set GC variable names, create GCs, initialize
postscript data structures, cat all the procedures used together.

{\bf IMPORTANT}:\\
In order to create postscript command file, we need environment
variable DEVE (i.e., setenv DEVE /u/jimwen/3D/version28) or AXIOM (e.g., setenv
AXIOM /spad/mnt/rt in case Gdraws directory has been installed on the server).
Without this path, the program would not know where the postscript files (in
Gdraws/PS) are.

{\bf LIMITATIONS} of current implementation:\\
A picture is printed with 1 inch x direction, and 1 inch y direction 
offset, and the largest complete picutre is the size of the page
with the offest.

{\bf BUGS}:\\
The region box is not drawn correctly when perspective is altered.


{\bf FUTURE DIRECTIONS}:
\begin{itemize}
\item for view3D color rendering, may want to convert LINE drawing color
to the appropriate grayscale.  Right now, they're all drawn in black.
\item for view3D's routines for color rendering, may want to implement
color drawing for postscript functions just in case someone does
have access to a color postscript printer.
\item implement more functionality for attributes used in GC, i.e., dashed
line, dotted line etc.
\item implement a display postscript menu to set things like picture size,
landscape/portrait orientation, picture centered, left, right, up,
down, etc., reversed video.
\item make font an attribute in postscripts's graphics context so the
font can be set in user program.  Right now, it uses only 1 font.
\item for view2D's stuff, implement a smaller font for the drawing the 
units on the axes.
\end{itemize}

\section{environment variables}
<<environment>>=
IN=	$(axiom_src_srcdir)/graph/Gdraws
OUT=	$(axiom_target_libdir)
PS=	$(axiom_target_libdir)/graph
DOC=    $(axiom_target_docdir)/src/graph

# local include files shared by graphics
LINC=	$(axiom_src_srcdir)/graph/include

# global include files shared by everyone
GINC=	$(axiom_src_srcdir)/include

# include files in Hyperdoc
HINC=	$(axiom_src_srcdir)/hyper

# bitmaps for cursors
BIT=	$(axiom_src_srcdir)/graph/include/bitmaps

# a .h file stuck in a really wierd place
DOTH=	$(axiom_src_srcdir)/graph/viewman

# a .c file in the library subdirectory
DOTC=	$(axiom_src_srcdir)/lib

pamphlets = Gfun.c.pamphlet psFiles.pamphlet Makefile.pamphlet

AXIOM_CFLAGS = ${CCF} -I${LINC} -I${GINC} -I$(srcdir) -I${HINC} \
		$(axiom_includes) ${AXIOM_X11_CFLAGS}

@
\section{Gdraw code}
\subsection{Gfun}
<<Gfun.c>>=
Gfun.c: $(srcdir)/Gfun.c.pamphlet
	$(axiom_build_document) --tangle --output=$@ $<

@

<<Gfun.o>>=
Gfun.$(OBJEXT): ${HEADERS}

Gfun.$(OBJEXT): $(builddir)/Gfun.c 
	${COMPILE} -o $@ $(CFLAGS) $(AXIOM_CFLAGS) $<

@

<<*>>=
<<environment>>

subdir = src/graph/Gdraws/

pamphlets = Makefile.pamphlet Gfun.c.pamphlet psFiles.pamphlet

HEADERS = ${IN}/Gdraws0.h ${LINC}/G.h     ${LINC}/Gfun.H1    \
          ${GINC}/hash.h  ${GINC}/hash.H1 ${GINC}/useproto.h \
		$(axiom_c_macros_h)

PSFiles= ${PS}/colorpoly.ps ${PS}/colorwol.ps  ${PS}/draw.ps      \
         ${PS}/drawIstr.ps  ${PS}/drawarc.ps   ${PS}/drawcolor.ps \
         ${PS}/drawline.ps  ${PS}/drawlines.ps ${PS}/drawpoint.ps \
         ${PS}/drawrect.ps  ${PS}/drawstr.ps   ${PS}/drwfilled.ps \
         ${PS}/end.ps       ${PS}/fillarc.ps   ${PS}/fillpoly.ps  \
         ${PS}/fillwol.ps   ${PS}/header.ps    ${PS}/setup.ps

.SUFFIXES:
.SUFFIXES: .c .lo .h .ps

.PHONY: all all-ax all-Gdraws
all: all-ax
all-ax all-Gdraws: stamp
	@ echo finished making $(axiom_src_srcdir)/Gdraws

.PHONY: PSfiles.post
stamp:  Gfun.$(OBJEXT) $(PSfiles)
	@rm -f stamp
	$(STAMP) stamp

$(PS)/%.ps: $(srcdir)/psFiles.pamphlet
	$(axiom_build_document) --tangle=$* --output=$@ $<

<<Gfun.c>>
<<Gfun.o>>

mostlyclean-local:
	@rm -f Gfun.$(OBJEXT)

clean-local: mostlyclean-local
	@rm -f $(PSFiles)

distclean-local: clean-local

@
\eject
\begin{thebibliography}{99}
\bibitem{1} nothing
\end{thebibliography}
\end{document}