1 /*
2 Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are
7 met:
8 
9     - Redistributions of source code must retain the above copyright
10       notice, this list of conditions and the following disclaimer.
11 
12     - Redistributions in binary form must reproduce the above copyright
13       notice, this list of conditions and the following disclaimer in
14       the documentation and/or other materials provided with the
15       distribution.
16 
17     - Neither the name of The Numerical ALgorithms Group Ltd. nor the
18       names of its contributors may be used to endorse or promote products
19       derived from this software without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23 TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
25 OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33 
34 extern int              scrn;
35 extern Display          *dsply;
36 extern XFontStruct      *globalFont, *buttonFont, *headerFont,
37                         *titleFont, *graphFont,
38                         *lightingFont, *volumeFont, *quitFont, *saveFont,
39                         *serverFont;
40 extern XrmDatabase      rDB;
41 
42 extern char             scaleReport[5], deltaXReport[5], deltaYReport[5];
43 extern unsigned long    *spadColors;
44 extern int              followMouse, gotToggle, viewportKeyNum;
45 extern Window           rtWindow, quitWindow, saveWindow;
46 extern GC               globalGC1, globalGC2, anotherGC, globGC, trashGC,
47                         componentGC, opaqueGC, renderGC,
48                         controlMessageGC, lightingGC, volumeGC, quitGC,
49                         saveGC, graphGC;
50 extern XSizeHints       viewSizeHints;
51 extern HashTable        *table;
52 extern Colormap         colorMap;
53 extern int              Socket, ack;
54 
55 extern GC               processGC;
56 extern viewPoints       *viewport;
57 extern controlPanelStruct *control;
58 extern XGCValues        gcVals;
59 extern char             *s;
60 extern int              someInt;
61 
62 extern unsigned long    foregroundColor, backgroundColor;
63 extern int              mono, totalColors,
64                         totalHues, totalSolidShades, totalSolid,
65                         totalDitheredAndSolids,totalShades;
66 
67 extern int              drawMore;
68 extern int              spadMode,spadDraw;
69 extern int              spadSignalReceived;
70 extern int              inNextEvent;
71 extern jmp_buf          jumpFlag;
72 
73 extern char             errorStr[80];
74 
75 extern view3DStruct     viewData;
76 
77 extern Window           lightingWindow, lightingAxes;
78 extern float            lightPointer[3], tempLightPointer[3];
79 extern float            lightIntensity, tempLightIntensity;
80 extern float            backLightIntensity;
81 
82 extern char             filename[256];
83 
84 
85   /** stuff from draw viewport routines */
86 extern float            sinTheta, sinPhi, cosTheta, cosPhi,
87                         viewScale, viewScaleX, viewScaleY, viewScaleZ, reScale;
88 extern int              xCenter, yCenter;
89 extern XWindowAttributes vwInfo;
90 extern XWindowAttributes graphWindowAttrib;
91 extern XPoint           *quadMesh;
92 extern int              *xPts;
93 extern XImage           *imageX;
94 
95 extern float            eyePoint[3];
96 
97 extern XPoint           polygonMesh[20];
98 
99 extern int              saveFlag;
100 extern int              firstTime, noTrans, startup;
101 extern int              redrawView;
102 extern int              finishedList, redoSmooth, redoColor, zoomed,
103                         rotated, switchedPerspective, changedEyeDistance,
104                         translated, changedIntensity, movingLight, writeImage,
105                         pixelSetFlag, redoDither, multiColorFlag;
106 extern poly             *quickList;
107 
108 extern int              viewAloned;
109 
110 extern viewTriple       corners[8], clipCorners[8];
111 extern boxSideStruct    box[6], clipBox[6];
112 extern int              axesXY[3][4];
113 extern float            axesZ[3][2];
114 
115 extern viewTriple       *splitPoints;
116 extern int              resMax;
117 
118 extern Window           volumeWindow;
119 extern int              frustrumVertex;
120 extern int              doingPanel;
121 extern int              doingVolume;
122 extern int              screenX;
123 extern float            xClipMinN, xClipMaxN,
124                         yClipMinN, yClipMaxN,
125                         zClipMinN, zClipMaxN,
126                         clipValue;
127 
128 extern float            pzMin, pzMax;
129 
130 extern int              maxGreyShade;
131 
132 extern char             propertyName[];
133 extern char             propertyBuffer[];
134 
135 extern float            transform[4][4], transform1[4][4],
136                         R[4][4], R1[4][4], S[4][4], T[4][4], I[4][4];
137 extern float            vxmax,vxmin,vymax,vymin,
138                         wxmax,wxmin,wymax,wymin,wzmax,wzmin;
139 
140 extern polyList         *scanList[ARRAY_HEIGHT];
141 extern int              scanline, polyCount;
142 extern float            xleft, xright;
143 
144 extern colorBuffer      cBuffer[ARRAY_WIDTH];
145 extern float            zBuffer[ARRAY_WIDTH];
146 
147 extern float            zC, dzdx;
148 extern float            intersectColor[2], dcolor;
149 extern triple           dpt, dnorm;
150 
151 extern float            Cspec, Cdiff, Camb, coeff, lum, saturation;
152 
153 extern Pixmap           viewmap;
154 extern int              viewmap_valid;
155 extern int              smoothHue;
156 extern int              smoothConst;
157 extern int              smoothError;
158 
159 extern char PSfilename[280];  /* used for ps file path */
160 extern char *env_fricas;
161 
162 extern Atom wm_delete_window;
163