atomes 1.2.1
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
save_opengl.c
Go to the documentation of this file.
1/* This file is part of the 'atomes' software
2
3'atomes' is free software: you can redistribute it and/or modify it under the terms
4of the GNU Affero General Public License as published by the Free Software Foundation,
5either version 3 of the License, or (at your option) any later version.
6
7'atomes' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
8without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9See the GNU General Public License for more details.
10
11You should have received a copy of the GNU Affero General Public License along with 'atomes'.
12If not, see <https://www.gnu.org/licenses/>
13
14Copyright (C) 2022-2025 by CNRS and University of Strasbourg */
15
22/*
23* This file: 'save_opengl.c'
24*
25* Contains:
26*
27
28 - The functions to save OpenGL information in the atomes project file format
29
30*
31* List of functions:
32
33 int save_atom_a (FILE * fp, project * this_proj, int s, int a);
34 int save_atom_b (FILE * fp, project * this_proj, int s, int a);
35 int save_rings_chains_data (FILE * fp, int type, int size, int steps, int data_max, int ** num_data, gboolean *** show, int **** all_data);
36 int write_this_image_label (FILE * fp, screen_label label);
37 int write_this_box (FILE * fp, box * abc);
38 int write_this_axis (FILE * fp, axis * xyz);
39 int save_opengl_image (FILE * fp, project * this_proj, image * img, int sid);
40
41*/
42
43#include "global.h"
44#include "project.h"
45#include "glwin.h"
46
57int save_atom_a (FILE * fp, project * this_proj, int s, int a)
58{
59 if (fwrite (& this_proj -> atoms[s][a].id, sizeof(int), 1, fp) != 1) return ERROR_RW;
60 if (fwrite (& this_proj -> atoms[s][a].sp, sizeof(int), 1, fp) != 1) return ERROR_RW;
61 if (fwrite (& this_proj -> atoms[s][a].x, sizeof(double), 1, fp) != 1) return ERROR_RW;
62 if (fwrite (& this_proj -> atoms[s][a].y, sizeof(double), 1, fp) != 1) return ERROR_RW;
63 if (fwrite (& this_proj -> atoms[s][a].z, sizeof(double), 1, fp) != 1) return ERROR_RW;
64 //g_debug ("Saving:: step= %d, at= %d, sp[%d]= %d, x[%d]= %f, y[%d]= %f, z[%d]= %f",
65 // s, a+1, a, this_proj -> atoms[s][a].sp, a, this_proj -> atoms[s][a].x, a, this_proj -> atoms[s][a].y, a, this_proj -> atoms[s][a].z);
66 return OK;
67}
68
79int save_atom_b (FILE * fp, project * this_proj, int s, int a)
80{
81 if (fwrite (this_proj -> atoms[s][a].show, sizeof(gboolean), 2, fp) != 2) return ERROR_RW;
82 if (fwrite (this_proj -> atoms[s][a].label, sizeof(gboolean), 2, fp) != 2) return ERROR_RW;
83 if (fwrite (& this_proj -> atoms[s][a].style, sizeof(int), 1, fp) != 1) return ERROR_RW;
84 return OK;
85}
86
101int save_rings_chains_data (FILE * fp, int type, int size, int steps, int data_max, int ** num_data, gboolean *** show, int **** all_data)
102{
103 int i, j, k;
104 if (fwrite (& data_max, sizeof(int), 1, fp) != 1) return ERROR_RW;
105 if (data_max)
106 {
107 for (i=0; i<steps; i++)
108 {
109 if (fwrite (num_data[i], sizeof(int), size, fp) != size) return ERROR_RW;
110 for (j=0; j<size; j++)
111 {
112 if (num_data[i][j])
113 {
114 //g_debug ("type= %d, steps= %d, j= %d, num_data[i][j]= %d", type, step, j, num_data[i][j]);
115 if (! type) if (fwrite (show[i][j], sizeof(int), num_data[i][j], fp) != num_data[i][j]) return ERROR_RW;
116 for (k=0; k<num_data[i][j]; k++)
117 {
118 if (fwrite (all_data[i][j][k], sizeof(int), j+1, fp) != j+1) return ERROR_RW;
119 }
120 }
121 }
122 }
123 }
124 return OK;
125}
126
136{
137 int i;
138 if (fwrite (& label.position, sizeof(int), 1, fp) != 1) return ERROR_RW;
139 if (fwrite (& label.render, sizeof(int), 1, fp) != 1) return ERROR_RW;
140 if (fwrite (& label.scale, sizeof(int), 1, fp) != 1) return ERROR_RW;
141 if (fwrite (label.shift, sizeof(double), 3, fp) != 3) return ERROR_RW;
142 if (fwrite (& label.n_colors, sizeof(int), 1, fp) != 1) return ERROR_RW;
143 for (i=0; i<label.n_colors; i++)
144 {
145 if (fwrite (& label.color[i], sizeof(ColRGBA), 1, fp) != 1) return ERROR_RW;
146 }
147 if (save_this_string (fp, label.font) != OK) return ERROR_RW;
148 return OK;
149}
150
159int write_this_box (FILE * fp, box * abc)
160{
161 if (fwrite (& abc -> box, sizeof(int), 1, fp) != 1) return ERROR_RW;
162 if (fwrite (& abc -> rad, sizeof(double), 1, fp) != 1) return ERROR_RW;
163 if (fwrite (& abc -> line, sizeof(double), 1, fp) != 1) return ERROR_RW;
164 if (fwrite (& abc -> color, sizeof(ColRGBA), 1, fp) != 1) return ERROR_RW;
165 if (fwrite (abc -> extra_cell, sizeof(int), 3, fp) != 3) return ERROR_RW;
166 return OK;
167}
168
177int write_this_axis (FILE * fp, axis * xyz)
178{
179 if (fwrite (& xyz -> axis, sizeof(int), 1, fp) != 1) return ERROR_RW;
180 if (fwrite (& xyz -> rad, sizeof(double), 1, fp) != 1) return ERROR_RW;
181 if (fwrite (& xyz -> line, sizeof(double), 1, fp) != 1) return ERROR_RW;
182 if (fwrite (& xyz -> color, sizeof(ColRGBA), 1, fp) != 1) return ERROR_RW;
183 if (fwrite (& xyz -> t_pos, sizeof(int), 1, fp) != 1) return ERROR_RW;
184 if (fwrite (& xyz -> length, sizeof(double), 1, fp) != 1) return ERROR_RW;
185 if (fwrite (xyz -> c_pos, sizeof(double), 3, fp) != 3) return ERROR_RW;
186 gboolean val;
187 int i;
188 if (xyz -> color != NULL)
189 {
190 val = TRUE;
191 }
192 else
193 {
194 val = FALSE;
195 }
196 if (fwrite (& val, sizeof(gboolean), 1, fp) != 1) return ERROR_RW;
197 if (val)
198 {
199 for (i=0; i<3; i++)
200 {
201 if (fwrite (& xyz -> color[i], sizeof(ColRGBA), 1, fp) != 1) return ERROR_RW;
202 }
203 }
204 if (fwrite (& xyz -> labels, sizeof(int), 1, fp) != 1) return ERROR_RW;
205 for (i=0; i<3; i++)
206 {
207 if (save_this_string (fp, xyz -> title[i]) != OK) return ERROR_RW;
208 }
209 return OK;
210}
211
222int save_opengl_image (FILE * fp, project * this_proj, image * img, int sid)
223{
224 int i, j, k, l;
225
226 if (fwrite (& img -> back -> gradient, sizeof(int), 1, fp) != 1) return ERROR_RW;
227 if (img -> back -> gradient)
228 {
229 if (fwrite (& img -> back -> direction, sizeof(int), 1, fp) != 1) return ERROR_RW;
230 if (fwrite (& img -> back -> position, sizeof(float), 1, fp) != 1) return ERROR_RW;
231 if (fwrite (img -> back -> gradient_color, sizeof(ColRGBA), 2, fp) != 2) return ERROR_RW;
232 }
233 else
234 {
235 if (fwrite (& img -> back -> color, sizeof(ColRGBA), 1, fp) != 1) return ERROR_RW;
236 }
237 if (this_proj -> modelgl -> custom_map != NULL) img -> color_map[0] += 10;
238 if (fwrite (img -> color_map, sizeof(int), 2, fp) != 2) return ERROR_RW;
239 if (this_proj -> modelgl -> custom_map != NULL)
240 {
241 img -> color_map[0] -= 10;
242 colormap * map = this_proj -> modelgl -> custom_map;
243 if (fwrite (& map -> points, sizeof(int), 1, fp) != 1) return ERROR_RW;
244 if (fwrite (& map -> cmax, sizeof(int), 1, fp) != 1) return ERROR_RW;
245 if (fwrite (& map -> cmin, sizeof(int), 1, fp) != 1) return ERROR_RW;
246 if (fwrite (map -> positions, sizeof(float), map -> points, fp) != map -> points) return ERROR_RW;
247 if (fwrite (map -> values, sizeof(ColRGBA), map -> points, fp) != map -> points) return ERROR_RW;
248 for (i=0; i<this_proj -> steps; i++)
249 {
250 if (fwrite (map -> data[i], sizeof(float), this_proj -> natomes, fp) != this_proj -> natomes) return ERROR_RW;
251 }
252 }
253
254 if (fwrite (& img -> cloned_poly, sizeof(gboolean), 1, fp) != 1) return ERROR_RW;
255 if (fwrite (img -> at_color, sizeof(ColRGBA), sid*2, fp) != sid*2) return ERROR_RW;
256 if (fwrite (img -> sphererad, sizeof(double), sid*2, fp) != sid*2) return ERROR_RW;
257 if (fwrite (img -> pointrad, sizeof(double), sid*2, fp) != sid*2) return ERROR_RW;
258 if (fwrite (img -> atomicrad, sizeof(double), sid*2, fp) != sid*2) return ERROR_RW;
259
260 for (i=0; i<sid*2; i++)
261 {
262 if (fwrite (img -> bondrad[i], sizeof(double), 2*sid, fp) != 2*sid) return ERROR_RW;
263 if (fwrite (img -> linerad[i], sizeof(double), 2*sid, fp) != 2*sid) return ERROR_RW;
264 }
265 if (fwrite (img -> radall, sizeof(double), 2, fp) != 2) return ERROR_RW;
266 if (fwrite (& img -> draw_clones, sizeof(gboolean), 1, fp) != 1) return ERROR_RW;
267
268 for (i=0; i<5; i++)
269 {
270 if (write_this_image_label(fp, img -> labels[i])) return ERROR_RW;
271 }
272 if (fwrite (img -> acl_format, sizeof(int), 2, fp) != 2) return ERROR_RW;
273 // Measures
274 if (fwrite (img -> mtilt, sizeof(gboolean), 2, fp) != 2) return ERROR_RW;
275 if (fwrite (img -> mpattern, sizeof(int), 2, fp) != 2) return ERROR_RW;
276 if (fwrite (img -> mfactor, sizeof(int), 2, fp) != 2) return ERROR_RW;
277 if (fwrite (img -> mwidth, sizeof(double), 2, fp) != 2) return ERROR_RW;
278 if (fwrite (& img -> m_is_pressed, sizeof(double), 1, fp) != 1) return ERROR_RW;
279
280 // Model box
281 if (write_this_box (fp, img -> abc)) return ERROR_RW;
282 // Axis
283 if (write_this_axis (fp, img -> xyz)) return ERROR_RW;
284
285 // OpenGL
286 if (fwrite (& img -> p_depth, sizeof(GLdouble), 1, fp) != 1) return ERROR_RW;
287 if (fwrite (& img -> gnear, sizeof(GLdouble), 1, fp) != 1) return ERROR_RW;
288 if (fwrite (& img -> gfar, sizeof(GLdouble), 1, fp) != 1) return ERROR_RW;
289 if (fwrite (& img -> gleft, sizeof(GLdouble), 1, fp) != 1) return ERROR_RW;
290 if (fwrite (& img -> gright, sizeof(GLdouble), 1, fp) != 1) return ERROR_RW;
291 if (fwrite (& img -> gtop, sizeof(GLdouble), 1, fp) != 1) return ERROR_RW;
292 if (fwrite (& img -> gbottom, sizeof(GLdouble), 1, fp) != 1) return ERROR_RW;
293 if (fwrite (& img -> rotation_quaternion, sizeof(vec4_t), 1, fp) != 1) return ERROR_RW;
294 if (fwrite (& img -> rotation_mode, sizeof(int), 1, fp) != 1) return ERROR_RW;
295 if (fwrite (& img -> zoom, sizeof(GLdouble), 1, fp) != 1) return ERROR_RW;
296 if (fwrite (img -> c_shift, sizeof(GLdouble), 2, fp) != 2) return ERROR_RW;
297 if (fwrite (& img -> style, sizeof(int), 1, fp) != 1) return ERROR_RW;
298 if (fwrite (& img -> quality, sizeof(GLint), 1, fp) != 1) return ERROR_RW;
299 if (fwrite (& img -> render, sizeof(GLint), 1, fp) != 1) return ERROR_RW;
300 if (fwrite (& img -> l_ghtning.lights, sizeof(int), 1, fp) != 1) return ERROR_RW;
301 for (i=0; i<img -> l_ghtning.lights; i++)
302 {
303 if (fwrite (& img -> l_ghtning.spot[i].type, sizeof(int), 1, fp) != 1) return ERROR_RW;
304 if (fwrite (& img -> l_ghtning.spot[i].fix, sizeof(int), 1, fp) != 1) return ERROR_RW;
305 if (fwrite (& img -> l_ghtning.spot[i].show, sizeof(int), 1, fp) != 1) return ERROR_RW;
306 if (fwrite (& img -> l_ghtning.spot[i].position, sizeof(vec3_t), 1, fp) != 1) return ERROR_RW;
307 if (fwrite (& img -> l_ghtning.spot[i].direction, sizeof(vec3_t), 1, fp) != 1) return ERROR_RW;
308 if (fwrite (& img -> l_ghtning.spot[i].intensity, sizeof(vec3_t), 1, fp) != 1) return ERROR_RW;
309 if (fwrite (& img -> l_ghtning.spot[i].attenuation, sizeof(vec3_t), 1, fp) != 1) return ERROR_RW;
310 if (fwrite (& img -> l_ghtning.spot[i].spot_data, sizeof(vec3_t), 1, fp) != 1) return ERROR_RW;
311 }
312 if (fwrite (& img -> m_terial.predefine, sizeof(int), 1, fp) != 1) return ERROR_RW;
313 if (fwrite (& img -> m_terial.albedo, sizeof(vec3_t), 1, fp) != 1) return ERROR_RW;
314 if (fwrite (img -> m_terial.param, sizeof(GLfloat), 6, fp) != 6) return ERROR_RW;
315 if (fwrite (& img -> f_g.mode, sizeof(int), 1, fp) != 1) return ERROR_RW;
316 if (fwrite (& img -> f_g.based, sizeof(int), 1, fp) != 1) return ERROR_RW;
317 if (fwrite (& img -> f_g.density, sizeof(float), 1, fp) != 1) return ERROR_RW;
318 if (fwrite (img -> f_g.depth, sizeof(float), 2, fp) != 2) return ERROR_RW;
319 if (fwrite (& img -> f_g.color, sizeof(vec3_t), 1, fp) != 1) return ERROR_RW;
320
321 if (fwrite (& img -> filled_type, sizeof(int), 1, fp) != 1) return ERROR_RW;
322 if (fwrite (& img -> step, sizeof(int), 1, fp) != 1) return ERROR_RW;
323 if (fwrite (& img -> rep, sizeof(int), 1, fp) != 1) return ERROR_RW;
324 for (i=0; i<4; i++)
325 {
326 if (i < 2)
327 {
328 for (j=0; j<sid; j++)
329 {
330 if (fwrite (img -> spcolor[i][j], sizeof(ColRGBA), this_proj -> coord -> ntg[i][j], fp) != this_proj -> coord -> ntg[i][j]) return ERROR_RW;
331 }
332 }
333 else
334 {
335 j = (this_proj -> modelgl -> adv_bonding[i-2] && this_proj -> coord -> totcoord[i]) ? this_proj -> coord -> totcoord[i] : 0;
336 if (fwrite (& j, sizeof(int), 1, fp) != 1) return ERROR_RW;
337 if (j)
338 {
339 if (fwrite (img -> spcolor[i][0], sizeof(ColRGBA), this_proj -> coord -> totcoord[i], fp) != this_proj -> coord -> totcoord[i]) return ERROR_RW;
340 }
341 }
342 }
343 if (fwrite (& this_proj -> modelgl -> rings, sizeof(gboolean), 1, fp) != 1) return ERROR_RW;
344 if (this_proj -> modelgl -> rings)
345 {
346 for (i=0; i<5; i++)
347 {
348 if (save_rings_chains_data (fp, 0, this_proj -> rsparam[i][1], this_proj -> steps,
349 this_proj -> modelgl -> ring_max[i],
350 this_proj -> modelgl -> num_rings[i],
351 this_proj -> modelgl -> show_rpoly[i],
352 this_proj -> modelgl -> all_rings[i]) != OK) return ERROR_RINGS;
353 }
354 }
355 if (fwrite (& this_proj -> modelgl -> chains, sizeof(gboolean), 1, fp) != 1) return ERROR_RW;
356 if (this_proj -> modelgl -> chains)
357 {
358 if (save_rings_chains_data (fp, 1, this_proj -> csparam[5], this_proj -> steps,
359 this_proj -> modelgl -> chain_max,
360 this_proj -> modelgl -> num_chains,
361 NULL,
362 this_proj -> modelgl -> all_chains) != OK) return ERROR_CHAINS;
363 }
364 if (this_proj -> modelgl -> volumes)
365 {
366 i = 1;
367 if (fwrite (& i, sizeof(int), 1, fp) != 1) return ERROR_RW;
368 for (i=0; i<FILLED_STYLES; i++)
369 {
370 if (fwrite (this_proj -> modelgl -> atoms_volume[i], sizeof(double), this_proj -> steps, fp) != this_proj -> steps) return ERROR_RW;
371 if (fwrite (this_proj -> modelgl -> atoms_ppvolume[i], sizeof(double), this_proj -> steps, fp) != this_proj -> steps) return ERROR_RW;
372 for (j=0; j<this_proj -> steps; j++)
373 {
374 if (fwrite (this_proj -> modelgl -> volume_box[i][j], sizeof(double), 9, fp) != 9) return ERROR_RW;
375 }
376 }
377 if (fwrite (this_proj -> modelgl -> comp_vol, sizeof(gboolean), FILLED_STYLES, fp) != FILLED_STYLES) return ERROR_RW;
378 if (fwrite (img -> show_vol, sizeof(gboolean), FILLED_STYLES, fp) != FILLED_STYLES) return ERROR_RW;
379 if (fwrite (img -> vol_col, sizeof(ColRGBA), FILLED_STYLES, fp) != FILLED_STYLES) return ERROR_RW;
380 if (this_proj -> modelgl -> adv_bonding[0])
381 {
382 if (fwrite (& this_proj -> coord -> totcoord[2], sizeof(int), 1, fp) != 1) return ERROR_RW;
383 for (i=0; i<FILLED_STYLES; i++)
384 {
385 j = 0;
386 for (k=0; k<this_proj -> steps; k++)
387 {
388 for (l=0; l<this_proj -> coord -> totcoord[2]; l++)
389 {
390 if (this_proj -> modelgl -> fm_comp_vol[0][i][k][l]) j++;
391 }
392 }
393 if (fwrite (& j, sizeof(int), 1, fp) != 1) return ERROR_RW;
394 if (j)
395 {
396 for (k=0; k<this_proj -> steps; k++)
397 {
398 for (l=0; l<this_proj -> coord -> totcoord[2]; l++)
399 {
400 if (this_proj -> modelgl -> fm_comp_vol[0][i][k][l])
401 {
402 if (fwrite (& k, sizeof(int), 1, fp) != 1) return ERROR_RW;
403 if (fwrite (& l, sizeof(int), 1, fp) != 1) return ERROR_RW;
404 if (fwrite (& this_proj -> modelgl -> frag_mol_ppvolume[0][i][k][l], sizeof(double), 1, fp) != 1) return ERROR_RW;
405 if (fwrite (this_proj -> modelgl -> frag_box[i][k][l], sizeof(double), 9, fp) != 9) return ERROR_RW;
406 }
407 }
408 }
409 if (fwrite (img -> fm_show_vol[0][i], sizeof(gboolean), this_proj -> coord -> totcoord[2], fp) != this_proj -> coord -> totcoord[2]) return ERROR_RW;
410 if (fwrite (img -> fm_vol_col[0][i], sizeof(ColRGBA), this_proj -> coord -> totcoord[2], fp) != this_proj -> coord -> totcoord[2]) return ERROR_RW;
411 }
412 }
413 if (this_proj -> modelgl -> adv_bonding[1])
414 {
415 if (fwrite (& this_proj -> coord -> totcoord[3], sizeof(int), 1, fp) != 1) return ERROR_RW;
416 for (i=0; i<FILLED_STYLES; i++)
417 {
418 j = 0;
419 for (k=0; k<this_proj -> steps; k++)
420 {
421 for (l=0; l<this_proj -> coord -> totcoord[3]; l++)
422 {
423 if (this_proj -> modelgl -> fm_comp_vol[1][i][k][l]) j++;
424 }
425 }
426 if (fwrite (& j, sizeof(int), 1, fp) != 1) return ERROR_RW;
427 if (j)
428 {
429 for (k=0; k<this_proj -> steps; k++)
430 {
431 for (l=0; l<this_proj -> coord -> totcoord[3]; l++)
432 {
433 if (this_proj -> modelgl -> fm_comp_vol[1][i][k][l])
434 {
435 if (fwrite (& k, sizeof(int), 1, fp) != 1) return ERROR_RW;
436 if (fwrite (& l, sizeof(int), 1, fp) != 1) return ERROR_RW;
437 if (fwrite (& this_proj -> modelgl -> frag_mol_ppvolume[1][i][k][l], sizeof(double), 1, fp) != 1) return ERROR_RW;
438 }
439 }
440 }
441 if (fwrite (img -> fm_show_vol[1][i], sizeof(gboolean), this_proj -> coord -> totcoord[3], fp) != this_proj -> coord -> totcoord[3]) return ERROR_RW;
442 if (fwrite (img -> fm_vol_col[1][i], sizeof(ColRGBA), this_proj -> coord -> totcoord[3], fp) != this_proj -> coord -> totcoord[3]) return ERROR_RW;
443 }
444 }
445 }
446 else
447 {
448 i = 0;
449 if (fwrite (& i, sizeof(int), 1, fp) != 1) return ERROR_RW;
450 }
451 }
452 else
453 {
454 i = 0;
455 if (fwrite (& i, sizeof(int), 1, fp) != 1) return ERROR_RW;
456 }
457 }
458 else
459 {
460 i = 0;
461 if (fwrite (& i, sizeof(int), 1, fp) != 1) return ERROR_RW;
462 }
463
464 for (i=0; i<this_proj -> steps; i++)
465 {
466 for (j=0; j< this_proj -> natomes; j++)
467 {
468 if (save_atom_b (fp, this_proj, i, j) != OK) return ERROR_ATOM_B;
469 }
470 }
471
472 // Finally selection lists, bonds, angles and dihedrals
473 for (i=0; i<2; i++)
474 {
475 if (fwrite (& img -> selected[i] -> selected, sizeof(int), 1, fp) != 1) return ERROR_RW;
476 if (img -> selected[i] -> selected)
477 {
478 atom_in_selection * at = img -> selected[i] -> first;
479 for (j=0; j<img -> selected[i] -> selected; j++)
480 {
481 if (fwrite (& at -> id, sizeof(int), 1, fp) != 1) return ERROR_RW;
482 if (at -> next) at = at -> next;
483 }
484 if (img -> selected[i] -> selected >= 2 && img -> selected[i] -> selected <= 20)
485 {
486 j = num_bonds (img -> selected[i] -> selected);
487 if (fwrite (img -> selected[i] -> selected_bonds, sizeof(int), j, fp) != j) return ERROR_RW;
488 if (img -> selected[i] -> selected >= 3)
489 {
490 j = num_angles (img -> selected[i] -> selected);
491 if (fwrite (img -> selected[i] -> selected_angles, sizeof(int), j, fp) != j) return ERROR_RW;
492 if (img -> selected[i] -> selected >= 4 && img -> selected[i] -> selected <= 10)
493 {
494 j = num_dihedrals (img -> selected[i] -> selected);
495 if (fwrite (img -> selected[i] -> selected_dihedrals, sizeof(int), j, fp) != j) return ERROR_RW;
496 }
497 }
498 }
499 }
500 }
501
502 return OK;
503}
int num_bonds(int i)
number of distinct pair(s) of atoms in selection
Definition selection.c:183
int num_dihedrals(int i)
number of distinct quadruplet(s) of atoms in selection
Definition selection.c:207
int num_angles(int i)
number of distinct triplet(s) of atoms in selection
Definition selection.c:195
integer function chains()
Definition chains.F90:54
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
Definition labels.c:56
int atoms[NUM_STYLES][2]
float val
Definition dlp_init.c:117
dint rep
Definition dlp_edit.c:2227
field_object_match ** all_data[10]
FILE * fp
Global variable declarations Global convenience function declarations Global data structure defin...
#define ERROR_CHAINS
Definition global.h:292
#define ERROR_ATOM_B
Definition global.h:287
#define ERROR_RW
Definition global.h:282
#define ERROR_RINGS
Definition global.h:291
#define OK
Definition global.h:281
void zoom(glwin *view, int delta)
zoom in or zoom out in the OpenGL window
Definition glview.c:1017
render
Definition glview.h:191
int step
Definition ogl_draw.c:74
labels
Definition glview.h:223
Variable declarations related the OpenGL window Data structure declarations related the OpenGL wind...
#define FILLED_STYLES
Definition glwin.h:106
G_MODULE_EXPORT void cloned_poly(GtkWidget *widg, gpointer data)
cloned polyehdra callback - GTK3
Definition m_poly.c:181
position
Definition m_proj.c:48
double z
Definition ogl_draw.c:61
double y
Definition ogl_draw.c:61
double x
Definition ogl_draw.c:61
Function declarations for reading atomes project file Function declarations for saving atomes proje...
int save_this_string(FILE *fp, gchar *string)
save string to file
Definition save_p.c:49
int save_atom_b(FILE *fp, project *this_proj, int s, int a)
save atom data to file (b)
Definition save_opengl.c:79
int save_atom_a(FILE *fp, project *this_proj, int s, int a)
save atom data to file (a)
Definition save_opengl.c:57
int write_this_image_label(FILE *fp, screen_label label)
save image label to file
int save_rings_chains_data(FILE *fp, int type, int size, int steps, int data_max, int **num_data, gboolean ***show, int ****all_data)
saving rings and chains statistics data to file
int save_opengl_image(FILE *fp, project *this_proj, image *img, int sid)
save OpenGL image properties to file
int write_this_axis(FILE *fp, axis *xyz)
save OpenGL image axis properties to file
int write_this_box(FILE *fp, box *abc)
save OpenGL image box properties to file
Definition glwin.h:333
Definition glwin.h:351
Definition glwin.h:365
int a
Definition tab-1.c:95
GtkWidget * img
Definition workspace.c:70