atomes 1.2.1
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
ogl_draw.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: 'ogl_draw.c'
24*
25* Contains:
26*
27
28 - The OpenGL window drawing funcions
29
30*
31* List of functions:
32
33 void print_matrices ();
34 void setup_camera ();
35 void unrotate_camera ();
36 void duplicate_fog (Fog * new_fog, Fog * old_fog);
37 void duplicate_material (Material * new_mat, Material * old_mat);
38 void duplicate_material_and_lightning (image * new_img, image * old_img);
39 void duplicate_screen_label (screen_label * new_lab, screen_label * old_lab);
40 void add_image ();
41 void at_shift (atom * at, float * shift);
42 void at_unshift (atom * at, float * shift);
43 void draw (glwin * view);
44
45 screen_string * duplicate_screen_string (screen_string * old_s);
46 atom * duplicate_atom (atom * at);
47
48 image * duplicate_image (image * old_img);
49
50*/
51
52#include "global.h"
53#include "glview.h"
54#include "dlp_field.h"
55#include "preferences.h"
56#include <time.h>
57
58extern ColRGBA init_color (int id, int numid);
59extern Light * copy_light_sources (int dima, int dimb, Light * old_sp);
61double x, y, z;
62GLUquadricObj * quadric;
71int qual;
74int step;
75
76extern int nbs, nbl;
77extern void create_atom_lists (gboolean to_pick);
78extern int create_bond_lists (gboolean to_pick);
79extern int create_selection_lists ();
80extern void create_poly_lists ();
81extern void create_ring_lists ();
82extern int create_box_lists (int b_step);
83extern int create_axis_lists ();
84extern int create_pick_lists ();
85extern int create_label_lists ();
86extern void create_measures_lists ();
87extern void create_light_lists ();
88extern void create_slab_lists (project * this_proj);
89extern void create_volumes_lists ();
90extern void create_background_lists ();
91
98{
99 g_debug ("*** Print Matrices ***");
100 g_debug ("\n");
101 g_debug (":: MODEL_MATRIX");
102 m4_print (wingl -> model_matrix);
103 g_debug ("\n");
104 g_debug (":: VIEW_MATRIX");
105 m4_print (wingl -> view_matrix);
106 g_debug ("\n");
107 g_debug (":: MODEL_VIEW_MATRIX");
108 m4_print (wingl -> model_view_matrix);
109 g_debug ("\n");
110 g_debug (":: NORMAL_MATRIX");
111 m4_print (wingl -> normal_matrix);
112 g_debug ("\n");
113 g_debug (":: PROJECTION_MATRIX");
114 m4_print (wingl -> projection_matrix);
115 g_debug ("\n");
116 g_debug (":: PROJECTION_MODEL_VIEW_MATRIX");
117 m4_print (wingl -> proj_model_view_matrix);
118}
119
126{
127 wingl -> model_position = vec3 (0.0, 0.0, -plot -> p_depth);
128 wingl -> model_matrix = m4_translation (wingl -> model_position);
129 wingl -> proj_model_matrix = m4_mul (wingl -> projection_matrix, wingl -> model_matrix);
130 wingl -> view_matrix = m4_quat_rotation (plot -> rotation_quaternion);
131 vec4_t quat;
132 quat = plot -> rotation_quaternion;
133 quat.z = - quat.z;
134 wingl -> un_view_matrix = m4_quat_rotation (quat);
135 wingl -> model_view_matrix = m4_mul (wingl -> model_matrix, wingl -> view_matrix);
136 wingl -> normal_matrix = m4_transpose (m4_invert_affine(wingl -> model_matrix));
137 wingl -> proj_model_view_matrix = m4_mul (wingl -> projection_matrix, wingl -> model_view_matrix);
138 wingl -> proj_view_matrix = m4_mul (wingl -> projection_matrix, wingl -> view_matrix);
139 wingl -> view_model_matrix = m4_mul (wingl -> view_matrix, wingl -> model_matrix);
140 // print_matrices();
141}
142
149{
150 vec4_t quat;
151 quat = plot -> rotation_quaternion;
152 quat.z = - quat.z;
153 wingl -> model_view_matrix = m4_mul (wingl -> model_view_matrix, m4_quat_rotation (quat));
154}
155
164{
165 screen_string * new_s = g_malloc0 (sizeof*new_s);
166 new_s -> word = g_strdup_printf ("%s", old_s -> word);
167 new_s -> col = old_s -> col;
168 int i;
169 for (i=0; i<3; i++) new_s -> shift[i] = old_s -> shift[i];
170 new_s -> num_instances = old_s -> num_instances;
171 new_s -> instances = duplicate_float (old_s -> num_instances*4, old_s -> instances);
172 new_s -> prev = NULL;
173 new_s -> last = NULL;
174 return new_s;
175}
176
186void duplicate_material (Material * new_mat, Material * old_mat)
187{
188 new_mat -> predefine = old_mat -> predefine;
189 new_mat -> albedo = old_mat -> albedo;
190 int i;
191 for (i=0; i<6; i++) new_mat -> param[i] = old_mat -> param[i];
192}
193
203void duplicate_fog (Fog * new_fog, Fog * old_fog)
204{
205 new_fog -> mode = old_fog -> mode;
206 new_fog -> based = old_fog -> based;
207 new_fog -> density = old_fog -> density;
208 int i;
209 for (i=0; i<2; i++) new_fog -> depth[i] = old_fog -> depth[i];
210 new_fog -> color = old_fog -> color;
211}
212
222{
223 new_img -> quality = old_img -> quality;
224 new_img -> render = old_img -> render;
225 duplicate_material (& new_img -> m_terial, & old_img -> m_terial);
226 new_img -> l_ghtning.lights = old_img -> l_ghtning.lights;
227 new_img -> l_ghtning.spot = copy_light_sources (old_img -> l_ghtning.lights, old_img -> l_ghtning.lights, old_img -> l_ghtning.spot);
228 duplicate_fog (& new_img -> f_g, & old_img -> f_g);
229}
230
240{
241 screen_string * stmp_a, * stmp_b;
242
243 new_lab -> position = old_lab -> position;
244 new_lab -> render = old_lab -> render;
245 new_lab -> scale = old_lab -> scale;
246 new_lab -> font = g_strdup_printf ("%s", old_lab -> font);
247 new_lab -> color = NULL;
248 int i;
249 for (i=0; i<3; i++) new_lab -> shift[i] = old_lab -> shift[i];
250 new_lab -> n_colors = old_lab -> n_colors;
251 if (old_lab -> color != NULL)
252 {
253 new_lab -> color = duplicate_color (new_lab -> n_colors, old_lab -> color);
254 }
255 new_lab -> list = NULL;
256 if (old_lab -> list != NULL)
257 {
258 new_lab -> list = duplicate_screen_string (old_lab -> list);
259 new_lab -> list -> last = duplicate_screen_string (old_lab -> list -> last);
260 stmp_a = old_lab -> list -> last;
261 stmp_b = new_lab -> list -> last;
262 while (stmp_a -> prev != NULL)
263 {
264 stmp_b -> prev = duplicate_screen_string (stmp_a -> prev);
265 stmp_b -> prev -> last = stmp_b -> last;
266 stmp_a = stmp_a -> prev;
267 stmp_b = stmp_b -> prev;
268 }
269 }
270}
271
280{
281 int i, j, k, l, m;
282 image * new_img = g_malloc0 (sizeof*new_img);
283
284 // This line will copy all the stuff that is not dynamically allocated
285 * new_img = * old_img;
286
287 new_img -> back = g_malloc0(sizeof*new_img -> back);
288 duplicate_background_data (new_img -> back, old_img -> back);
289 j = proj_gl -> nspec;
290 for (i=0; i<2; i++)
291 {
292 new_img -> color_map[i] = old_img -> color_map[i];
293 new_img -> show_atom[i] = duplicate_bool(j, old_img -> show_atom[i]);
294 new_img -> show_label[i] = duplicate_bool(j, old_img -> show_label[i]);
295 }
296
297 new_img -> sphererad = duplicate_double(2*j, old_img -> sphererad);
298 new_img -> pointrad = duplicate_double(2*j, old_img -> pointrad);
299 new_img -> atomicrad = duplicate_double(2*j, old_img -> atomicrad);
300 new_img -> bondrad = g_malloc0 (2*j*sizeof*new_img -> bondrad);
301 new_img -> linerad = g_malloc0 (2*j*sizeof*new_img -> linerad);
302 new_img -> at_color = duplicate_color (2*j, old_img -> at_color);
303 for (i=0; i<2*j; i++)
304 {
305 new_img -> bondrad[i] = duplicate_double(2*j, old_img -> bondrad[i]);
306 new_img -> linerad[i] = duplicate_double(2*j, old_img -> linerad[i]);
307 }
308
309 for (i=0; i<9; i++)
310 {
311 new_img -> show_coord[i] = duplicate_bool(coord_gl -> totcoord[i], old_img -> show_coord[i]);
312 if (i < 2 || i > 3) new_img -> show_poly[i] = duplicate_bool(coord_gl -> totcoord[i], old_img -> show_poly[i]);
313 k = (i < 2) ? proj_gl -> nspec : 1;
314 new_img -> spcolor[i] = g_malloc (k*sizeof*new_img -> spcolor[i]);
315 for (j=0; j<k; j++)
316 {
317 new_img -> spcolor[i][j] = duplicate_color (coord_gl -> totcoord[i], old_img -> spcolor[i][j]);
318 }
319 }
320 new_img -> at_data = g_malloc0 (proj_gl -> natomes*sizeof*new_img -> at_data);
321 for (i=0; i<proj_gl -> natomes; i++)
322 {
323 new_img -> at_data[i].show[0] = proj_gl -> atoms[step][i].show[0];
324 new_img -> at_data[i].show[1] = proj_gl -> atoms[step][i].show[1];
325 new_img -> at_data[i].label[0] = proj_gl -> atoms[step][i].label[0];
326 new_img -> at_data[i].label[1] = proj_gl -> atoms[step][i].label[1];
327 new_img -> at_data[i].pick[0] = proj_gl -> atoms[step][i].pick[0];
328 new_img -> at_data[i].cloned = proj_gl -> atoms[step][i].cloned;
329 new_img -> at_data[i].style = proj_gl -> atoms[step][i].style;
330 }
331
332 for (i=0; i<3; i++)
333 {
334 new_img -> xyz -> title[i] = g_strdup_printf ("%s", old_img -> xyz -> title[i]);
335 }
336 new_img -> xyz -> color = NULL;
337 if (old_img -> xyz -> color != NULL)
338 {
339 new_img -> xyz -> color = duplicate_color (3, old_img -> xyz -> color);
340 }
341
342 for (i=0; i<5; i++) duplicate_screen_label (& new_img -> labels[i], & old_img -> labels[i]);
343 duplicate_material_and_lightning (new_img, old_img);
344
345 // Atom selection
346 for (i=0; i<2; i++) new_img -> selected[i] = duplicate_ogl_selection (old_img -> selected[i]);
347
348 // Rings poly if any 'isolated'
349 if (wingl -> rings)
350 {
351 for (i=0; i<5; i++)
352 {
353 if (wingl -> ring_max[i])
354 {
355 m = 0;
356 for (j=0; j< coord_gl -> totcoord[i+4]; j++)
357 {
358 k = coord_gl -> geolist[i+4][0][j];
359 for (l=0; l<wingl -> num_rings[i][step][k-1]; l++)
360 {
361 if (wingl -> show_rpoly[i][step][k-1][l]) m++;
362 }
363 }
364 if (m)
365 {
366 new_img -> i_rings[i] = allocdint (m+1, 2);
367 new_img -> i_rings[i][0][0] = m;
368 m = 1;
369 for (j=0; j<coord_gl -> totcoord[i+4]; j++)
370 {
371 k = coord_gl -> geolist[i+4][0][j];
372 for (l=0; l<wingl -> num_rings[i][step][k-1]; l++)
373 {
374 if (wingl -> show_rpoly[i][step][k-1][l])
375 {
376 new_img -> i_rings[i][m][0] = j;
377 new_img -> i_rings[i][m][1] = l;
378 m ++;
379 }
380 }
381 }
382 }
383 }
384 }
385 }
386
387 // Volumes
388 if (wingl -> volumes)
389 {
390 for (i=0; i<2; i++)
391 {
392 for (j=0; j<FILLED_STYLES; j++)
393 {
394 new_img -> fm_show_vol[i][j] = duplicate_bool (coord_gl -> totcoord[2+i], old_img -> fm_show_vol[i][j]);
395 for (k=0; k<coord_gl -> totcoord[2+i]; k++)
396 {
397 new_img -> fm_vol_col[i][j][k] = old_img -> fm_vol_col[i][j][k];
398 }
399 }
400 }
401 }
402 return new_img;
403}
404
411{
412 snapshot * nextsnap = g_malloc0 (sizeof*nextsnap);
413 nextsnap -> img = duplicate_image (plot);
414 nextsnap -> img -> id ++;
415
416 // Now the pointers
417 if (wingl -> anim -> frames == 0)
418 {
419 wingl -> anim -> first -> prev = NULL;
420 wingl -> anim -> last = nextsnap;
421 wingl -> anim -> last -> prev = NULL;
422 wingl -> anim -> first = nextsnap;
423
424 }
425 else
426 {
427 wingl -> anim -> last -> next = nextsnap;
428 nextsnap -> prev = wingl -> anim -> last;
429 wingl -> anim -> last = wingl -> anim -> last -> next;
430 wingl -> anim -> last -> img -> id = wingl -> anim -> frames;
431 }
432 wingl -> anim -> frames += 1;
433}
434
436
445{
446 atom * bt = g_malloc0 (sizeof*bt);
447 bt -> x = at -> x;
448 bt -> y = at -> y;
449 bt -> z = at -> z;
450 bt -> sp = at -> sp;
451 bt -> id = at -> id;
452 bt -> style = at -> style;
453 bt -> cloned = at -> cloned;
454 int i;
455 for (i=0; i<2; i++)
456 {
457 bt -> show[i] = at -> show[i];
458 bt -> pick[i] = at -> pick[i];
459 bt -> label[i] = at -> label[i];
460 }
461 for (i=0; i<5; i++)
462 {
463 bt -> coord[i] = at -> coord[i];
464 }
465 bt -> numv = at -> numv;
466 bt -> fid = at -> fid;
467 bt -> faid = at -> faid;
468 if (bt -> numv) bt -> vois = duplicate_int (bt -> numv, at -> vois);
469 return bt;
470}
471
480void at_shift (atom * at, float * shift)
481{
482 at -> x += shift[0];
483 at -> y += shift[1];
484 at -> z += shift[2];
485}
486
495void at_unshift (atom * at, float * shift)
496{
497 at -> x -= shift[0];
498 at -> y -= shift[1];
499 at -> z -= shift[2];
500}
501
509void draw (glwin * view)
510{
511 wingl = view;
512 proj_gl = get_project_by_id(view -> proj);
513 proj_sp = proj_gl -> nspec;
514 proj_at = proj_gl -> natomes;
515 coord_gl = proj_gl -> coord;
516 cell_gl = & proj_gl -> cell;
517 plot = wingl -> anim -> last -> img;
518 qual = plot -> quality-1;
519 acolorm = plot -> color_map[0];
520 pcolorm = plot -> color_map[1];
521 step = plot -> step;
522 int box_step = (cell_gl -> npt) ? step : 0;
523 box_gl = & cell_gl -> box[box_step];
524
525/* #ifdef DEBUG
526 clock_gettime (CLOCK_MONOTONIC, & start_time);
527 GLuint GPU_time;
528 glGenQueries (1, & GPU_time);
529 glBeginQuery (GL_TIME_ELAPSED, GPU_time);
530// #endif */
531 // First, if needed, we prepare the display lists
532 if (proj_at)
533 {
534 if (wingl -> create_shaders[ATOMS] && wingl -> n_shaders[ATOMS][step] < 0) create_atom_lists (FALSE);
535 if (wingl -> create_shaders[BONDS] && wingl -> n_shaders[BONDS][step] < 0) wingl -> n_shaders[BONDS][step] = create_bond_lists (FALSE);
536 if (wingl -> create_shaders[SELEC] && wingl -> n_shaders[SELEC][step] < 0) wingl -> n_shaders[SELEC][step] = create_selection_lists ();
537 if (wingl -> create_shaders[POLYS] && wingl -> n_shaders[POLYS][step] < 0) create_poly_lists ();
538 if (wingl -> create_shaders[RINGS] && wingl -> n_shaders[RINGS][step] < 0) create_ring_lists ();
539 if (wingl -> create_shaders[PICKS]) wingl -> n_shaders[PICKS][0] = create_pick_lists ();
540 if (wingl -> create_shaders[SLABS]) create_slab_lists (proj_gl);
541 if (wingl -> create_shaders[VOLMS] && wingl -> n_shaders[VOLMS][step] < 0) create_volumes_lists ();
542 if (wingl -> create_shaders[LABEL]) wingl -> n_shaders[LABEL][0] = create_label_lists ();
543 if (wingl -> create_shaders[MEASU]) create_measures_lists ();
544 }
545 else
546 {
547 int i;
548 for (i=0; i<NGLOBAL_SHADERS; i++) cleaning_shaders (wingl, i);
549 if (plot -> back -> gradient) wingl -> create_shaders[BACKG] = TRUE;
550 }
551 if (plot -> back -> gradient && wingl -> create_shaders[BACKG]) create_background_lists ();
552 if (wingl -> create_shaders[MDBOX]) wingl -> n_shaders[MDBOX][box_step] = create_box_lists (box_step);
553 if (wingl -> create_shaders[MAXIS]) wingl -> n_shaders[MAXIS][0] = create_axis_lists ();
554 if (wingl -> create_shaders[LIGHT]) create_light_lists ();
555
556 setup_camera ();
557 // We draw normal scene or picking mode scene (only atoms or selection)
558
559 if (wingl -> to_pick)
560 {
561 // Picking mode scene
562 glDisable (GL_LIGHTING);
563 glClearColor (plot -> back -> color.red,
564 plot -> back -> color.green,
565 plot -> back -> color.blue,
566 1.0);
567 glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
568
570
571 glEnable (GL_LIGHTING);
572 }
573 else
574 {
575 // Normal mode scene
576 glClearColor (plot -> back -> color.red,
577 plot -> back -> color.green,
578 plot -> back -> color.blue,
579 plot -> back -> color.alpha);
580 glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
581
582 // Gradient background
584
585 // We want to draw the elements by reverse order
586 // so that atoms will be last and and will appear on
587 // top of bonds and so on
588
589 // Box
591
592 // The bonds
594
595 // Now the atoms
597
598 // The selected atoms/bonds
600
601 int i = plot -> render;
602 plot -> render = FILL;
603
604 // Atom labels
606
607 // Axis if centered
608 if (view -> anim -> last -> img -> xyz -> t_pos == 4) draw_vertices (MAXIS);
609
610 // Last the coordination polyhedra
613
614 // Measures
616
617 // Slab
619
620 // Volumes
622
623 // Axis if not centered
624 if (view -> anim -> last -> img -> xyz -> t_pos != 4) draw_vertices (MAXIS);
625
626 // Lights
628
629 plot -> render = i;
630
631 //draw_labels ();
632 if (wingl -> record) add_image ();
633 }
634
635/* #ifdef DEBUG
636 glEndQuery (GL_TIME_ELAPSED);
637 GLint done = 0;
638 while (! done)
639 {
640 glGetQueryObjectiv (GPU_time, GL_QUERY_RESULT_AVAILABLE, & done);
641 }
642 GLint GPU_res;
643 glGetQueryObjectiv (GPU_time, GL_QUERY_RESULT, & GPU_res);
644 g_print (":: TIME TO RENDER (GPU) = %f s\n", (double)GPU_res/CLOCKS_PER_SEC);
645 clock_gettime (CLOCK_MONOTONIC, & stop_time);
646 g_print (":: TIME TO RENDER (CPU) = %s\n", calculation_time(FALSE, get_calc_time (start_time, stop_time)));
647// #endif */
648}
649
gchar * param[2]
double scale(double axe)
find appropriate major tick spacing based on axis length
Definition curve.c:204
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
Definition labels.c:56
vec3_t model_position
ColRGBA col
Definition d_measures.c:77
int * shift
Definition d_measures.c:72
int atoms[NUM_STYLES][2]
Variable declarations for the creation of the DL_POLY input file(s)
int * duplicate_int(int num, int *old_val)
copy a list of int
Definition global.c:560
float * duplicate_float(int num, float *old_val)
copy a list of float
Definition global.c:592
gboolean * duplicate_bool(int num, gboolean *old_val)
copy a list of gboolean
Definition global.c:576
int ** allocdint(int xal, int yal)
allocate an int ** pointer
Definition global.c:330
double * duplicate_double(int num, double *old_val)
copy a list of double
Definition global.c:608
Global variable declarations Global convenience function declarations Global data structure defin...
project * proj
ColRGBA * duplicate_color(int num, ColRGBA *col)
duplicate a ColRGBA pointer
Definition gtk-misc.c:1663
project * get_project_by_id(int p)
get project pointer using id number
Definition project.c:120
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
gboolean pick
render
Definition glview.h:191
@ FILL
Definition glview.h:192
void cleaning_shaders(glwin *view, int shader)
re-initialize an OpenGL shader
void draw_vertices(int id)
Draw OpenGL shader program.
labels
Definition glview.h:223
#define FILLED_STYLES
Definition glwin.h:106
@ BONDS
Definition glwin.h:90
@ PICKS
Definition glwin.h:97
@ LABEL
Definition glwin.h:98
@ VOLMS
Definition glwin.h:102
@ SLABS
Definition glwin.h:101
@ POLYS
Definition glwin.h:92
@ MAXIS
Definition glwin.h:94
@ SELEC
Definition glwin.h:91
@ MDBOX
Definition glwin.h:93
@ MEASU
Definition glwin.h:99
@ ATOMS
Definition glwin.h:89
@ RINGS
Definition glwin.h:96
@ BACKG
Definition glwin.h:103
@ LIGHT
Definition glwin.h:100
#define NGLOBAL_SHADERS
Definition glwin.h:69
position
Definition m_proj.c:48
image * plot
Definition ogl_draw.c:70
screen_string * duplicate_screen_string(screen_string *old_s)
create a copy a screen_string data structure
Definition ogl_draw.c:163
void create_background_lists()
prepare background OpenGL rendering
atom_selection * duplicate_ogl_selection(atom_selection *old_sel)
copy an atom selection
Definition calc.c:119
Light * copy_light_sources(int dima, int dimb, Light *old_sp)
create a copy of a list of light sources
Definition w_advance.c:402
GLUquadricObj * quadric
Definition ogl_draw.c:62
int create_bond_lists(gboolean to_pick)
prepare bond(s) and clone bond(s) OpenGL rendering
Definition d_bonds.c:670
void print_matrices()
print OpenGL matrices
Definition ogl_draw.c:97
void draw(glwin *view)
main drawing subroutine for the OpenGL window
Definition ogl_draw.c:509
int create_box_lists(int b_step)
prepare box OpenGL rendering
Definition d_box.c:292
void at_unshift(atom *at, float *shift)
correct atomic coordinates modified to display image in cell replica
Definition ogl_draw.c:495
project * proj_gl
Definition ogl_draw.c:64
glwin * wingl
Definition ogl_draw.c:63
void unrotate_camera()
unrotate OpenGL camera
Definition ogl_draw.c:148
void duplicate_material(Material *new_mat, Material *old_mat)
duplicate material data
Definition ogl_draw.c:186
void create_ring_lists()
prepare ring(s) polyhedra OpenGL rendering
Definition d_rings.c:169
void duplicate_screen_label(screen_label *new_lab, screen_label *old_lab)
copy screen_label data structure
Definition ogl_draw.c:239
int proj_sp
Definition ogl_draw.c:65
image * duplicate_image(image *old_img)
create a copy of an image data structure
Definition ogl_draw.c:279
void create_slab_lists(project *this_proj)
prepare slab(s) OpenGL rendering
Definition d_box.c:899
void at_shift(atom *at, float *shift)
modify atomic coordinates to display image in cell replica
Definition ogl_draw.c:480
void create_light_lists()
prepare light(s) OpenGL rendering
Definition d_box.c:469
ColRGBA init_color(int id, int numid)
initialize color based id number over total number of elements
Definition initcoord.c:81
void duplicate_material_and_lightning(image *new_img, image *old_img)
copy the material and lightning parameters of an image data structure
Definition ogl_draw.c:221
box_info * box_gl
Definition ogl_draw.c:68
void create_volumes_lists()
prepare volume(s) OpenGL rendering
Definition d_box.c:940
int nbs
Definition d_atoms.c:165
void setup_camera()
setup OpenGL camera
Definition ogl_draw.c:125
int create_label_lists()
prepare atomic label(s) OpenGL rendering
Definition d_label.c:158
void update_gl_pick_colors()
int create_pick_lists()
prepare the picking list OpenGL rendering
int qual
Definition ogl_draw.c:71
int create_axis_lists()
prepare axis OpenGL rendering
Definition d_axis.c:267
double z
Definition ogl_draw.c:61
void duplicate_fog(Fog *new_fog, Fog *old_fog)
duplicate fog data
Definition ogl_draw.c:203
double y
Definition ogl_draw.c:61
int step
Definition ogl_draw.c:74
void create_poly_lists()
prepare coordination polyhedra(s) OpenGL rendering
Definition d_poly.c:630
int pcolorm
Definition ogl_draw.c:73
int nbl
Definition ogl_draw.c:76
int acolorm
Definition ogl_draw.c:72
atom * duplicate_atom(atom *at)
copy (partially) an atom data structure
Definition ogl_draw.c:444
void create_atom_lists(gboolean to_pick)
prepare atom(s) and clone(s) OpenGL rendering
Definition d_atoms.c:599
int create_selection_lists()
prepare the selected atom(s) and bond(s) OpenGL rendering
coord_info * coord_gl
Definition ogl_draw.c:67
int proj_at
Definition ogl_draw.c:66
cell_info * cell_gl
Definition ogl_draw.c:69
void add_image()
add an image to the animation
Definition ogl_draw.c:410
double x
Definition ogl_draw.c:61
void create_measures_lists()
prepare measure(s) OpenGL rendering
Definition d_measures.c:670
void duplicate_background_data(background *new_back, background *old_back)
duplicate background data structure
Preference variable declarations.
Definition glwin.h:234
Definition glwin.h:182
Definition global.h:891
Definition glwin.h:351
double green
Definition color_box.h:35
double red
Definition color_box.h:34
double blue
Definition color_box.h:36
Definition glwin.h:965
Definition glwin.h:365
int style
Definition glwin.h:465
float z
Definition math_3d.h:149
GtkWidget * img
Definition workspace.c:70