1 // $Id: draw_gbl.h 1107 2011-01-19 23:53:52Z martin $
2 //
3 /* draw_gbl.h - global definitions for DRAWxtl */
4 
5 #include "DRAWxtlViewUI.h"
6 #include "EditView.h"
7 #include "Ellipsoids.h"
8 
9 DRAWxtlViewUI *drvui;
10 
11 int cur_show = 0;
12 
13 CrystalView *crystal;
14 
15 ArrowParam *arrows;
16 
17 SlabParam *Slabs;
18 
19 Fl_Window *textwindow;
20 
21 Fl_Window *listwindow1;
22 
23 Fl_Window *listwindow2;
24 
25 Fl_Window *listwindow3;
26 
27 Fl_Window *listwindow4;
28 
29 Fl_Window *listwindow5;
30 
31 Fl_Window *helpwindow;
32 
33 Fl_Window *helpwindow1;
34 
35 Fl_Window *helpwindow2;
36 
37 Fl_Window *helpwindow3;
38 
39 Fl_Window *helpwindow4;
40 
41 Fl_Window *helpwindow5;
42 
43 Fl_Window *helpwindow6;
44 
45 Fl_Text_Buffer *helpbuf = NULL;
46 
47 Fl_Text_Buffer *helpbuf1 = NULL;
48 
49 AutomationParam *Automate = NULL;
50 
51 BondParam *Bonds = NULL;
52 
53 PolyParam *Polyhedra = NULL;
54 
55 SphereParam *Spheres = NULL;
56 
57 ConfigParm *Configure;
58 
59 ConfigMiscParm *MiscConfigure;
60 
61 ConfigMSMSParm *MSMSConfigure;
62 
63 OmitParam *Omit = NULL;
64 
65 EditScreen *edtprm = NULL;
66 
67 Ellipsoids *ellipsoids = NULL;
68 
69 LonePairParam *LonePairs = NULL;
70 
71 MapsParam *Maps = NULL;
72 
73 SliceParam *Slice = NULL;
74 
75 SurfParam *Surf = NULL;
76 
77 ModParam *Modparms = NULL;
78 
79 GLuint selectBuf[BUFSIZE];
80 
81 Fl_Text_Buffer *textbuf = NULL;
82 
83 Fl_Text_Buffer *textbuf1 = NULL;
84 
85 Fl_Text_Buffer *textbuf2 = NULL;
86 
87 Fl_Text_Buffer *textbuf3 = NULL;
88 
89 Fl_Text_Buffer *textbuf4 = NULL;
90 
91 //float gl_pos_x = 0.0;
92 //float gl_pos_y = 0.0;
93 //float gl_pos_z = 0.0;
94 float gl_size = 0.;
95 
96 void *Edit_Str_Type;
97 
98 QUAT Rotq;
99 
100 double Xrot, Yrot, Zrot;	// Rotation angles
101 
102 double xmin, ymin, zmin;	// Minimums
103 
104 double xmax, ymax, zmax;	// Maximums
105 
106 Fl_Window *errorbox;
107 
108 int Edit_changed;
109 
110 int Edit_loading;
111 
112 /* global variables for atom lists */
113 
114 int natom;			/* number of different types of atoms */
115 
116 int ncell;			/* number of atoms in asymmetric unit */
117 
118 float *xypos = NULL;		/* master list of fractional coordinates (modulated) */
119 
120 float *xypos_nm = NULL;		/* master list of fractional coordinates (not modulated) */
121 
122 float *o_vert = NULL;		/* crystal coordinates of saved vertices (modulated) */
123 
124 float *o_vert_nm = NULL;	/* crystal coordinates of saved vertices (not modulated) */
125 
126 float *s_vert = NULL;		/* saved coordinates of vertices (modulated) */
127 
128 int *vert_sym_no = NULL;	/* saved symmetry operator number */
129 
130 int *vert_sym_nos = NULL;	/* saved symmetry operator number including sign */
131 
132 int *poly_list = NULL;		/* storage for polygon corner pointers */
133 
134 int nvert;			/* number of vertices in list */
135 
136 int NvertM;			/* number of vertices in master atom list */
137 
138 /* global variables for polyhedra, planes and bonds */
139 
140 int draw_list;			// number of items in polygon draw list
141 
142 int *vertex_list = NULL;	/* storage for vertices about a cation */
143 
144 int numb_list;			/* number in polygon list */
145 
146 int domolcomp;			/* non-zero if molecule completion requested */
147 
148 /* global variables that control size and orientation of output object */
149 
150 GLdouble modelMatrix[16];
151 
152 GLdouble projMatrix[16];
153 
154 GLint viewport[4];
155 
156 float DepthCue;			/* scale for Z-dependent thickness of edges */
157 
158 float boxlim[3];		/* half limits of plotting box */
159 
160 float origin[3];		/* position of plotting origin */
161 
162 double G_Rot[3][3];		/* Grand rotation matrix - transforms from Cartesian to picture */
163 
164 float POV_Max[3];		/* Maximum limits of POV after rotation */
165 
166 float POV_Min[3];		/* Minimum limits of POV after rotation */
167 
168 int boxflag;			/* Non-zero if 'bounds' command given */
169 
170 int packflag;			/* Non-zero if 'pack' command given */
171 
172 int clipflag;			/* Non-zero if 'clip' command given */
173 
174 int docell;			// non-zero if unit-cell edges to be drawn
175 
176 int Display_axes;		/* non-zero if axial triple to be drawn */
177 
178 int Color_Warning;		/* Warning flag for non-standard color */
179 
180 float Magnification;		// Magnification factor for image
181 
182 float Scale;			/* Scale of diagram */
183 
184 float offset[3];		/* offset for vector triple */
185 
186 float Text_Size;		/* Size to make axis label text */
187 
188 int Options;			/* Place to save command-line options flags */
189 
190 float rad_cell;			/* radius of unit cell framebars */
191 
192 int edges;			/* draw thin lines around the edges of polyhedra */
193 
194 float xrot, yrot, zrot;		/* view rotation angles */
195 
196 int Unit_Cell;			/* non-zero if unit cell to be drawn */
197 
198 int no_comment;			/* non-zero to inhibit comment lines in VRML */
199 
200 int M_cameras;			/* non-zero to inhibit multiple cameras */
201 
202 int Vrml2;			/* non-zero to generate VRML97 (VRML2) output */
203 
204 int X3D;			/* non-zero to write VRML2 in X3D-compatible syntax*/
205 
206 int doVrml;			/* non-zero to allow VRML output */
207 
208 int doPOV;			/* non-zero to allow povray output */
209 
210 int doAsy;			/* non-zero to allow asymptote output */
211 
212 float printdist;		/* Distance limit for tabulated output */
213 
214 int Labels;			/* True if labels should be output */
215 
216 int slabmode;			/* cutout: slab vertices */
217 
218 float slabx1, slaby1, slabz1, slabx2, slaby2, slabz2;
219 
220 float slabx3, slaby3, slabz3, slabx4, slaby4, slabz4;
221 
222 float slabv[24];
223 
224 float cur_cen[3];		/* location of cursor (fractional coordinates) */
225 
226 int cur_atom[4];		/* sequence numbers of last four atoms under cursor */
227 
228 char cur_name[4][10];		/* name of atom under cursor */
229 
230 float dist12 = 0.0;
231 
232 float dist23 = 0.0;
233 
234 float dist34 = 0.0;
235 
236 float ang123 = 0.0;
237 
238 float ang234 = 0.0;
239 
240 float torsion_ang = 0.0;
241 
242 /* Fourier map stuff */
243 
244 #include "drawmap.h"
245 int ReadFourMap = 0;		/* true if a Fourier map has been read */
246 
247 float *FourierPt = NULL;	/* pointer to Fourier map contents */
248 
249 float map_a, map_b, map_c, map_alpha, map_beta, map_gamma;	/* cell dimensions for map */
250 
251 int mapstep_a, mapstep_b, mapstep_c;	/* map steps across unit cell */
252 
253 float xMin, xMax, yMin, yMax, zMin, zMax;	/* bounding box for map */
254 
255 float x4Val, x5Val, x6Val;	/* coordinates of map intersection with superspace */
256 
257 float x4step, x5step, x6step;
258 
259 char FourierFileName[256];
260 
261 int FourierMapType;
262 
263 int ShowMapLegend;
264 
265 struct MAP_INFO Map_Info;
266