atomes 1.3.1
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
d_atoms.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-2026 by CNRS and University of Strasbourg */
15
21
22/*
23* This file: 'd_atoms.c'
24*
25* Contains:
26*
27
28 - The functions to prepare the OpenGL rendering atom(s) and clone(s)
29
30*
31* List of functions:
32
33 int sphere_vertices (int qual);
34 int sphere_indices (int qual);
35 int find_atom_vertices (gboolean to_pick);
36 int find_clone_vertices (gboolean to_pick);
37
38 float get_sphere_radius (int style, int sp, int ac, int sel);
39
40 void setup_sphere_vertice (float * vertices, vec3_t pos, ColRGBA col, float rad, float alpha);
41 void setup_this_atom (int style, gboolean to_pick, gboolean picked, atom * at, int ac, float * vert, float al);
42 void setup_atom_vertices (int style, gboolean to_pick, float * vertices);
43 void prepare_clone (int style, gboolean to_pick, int picked, atom at, atom bt, float x, float y, float z, float * vertices);
44 void setup_clone_vertices (int style, gboolean to_pick, float * vertices);
45 void atom_positions_colors_and_sizes (int style, gboolean to_pick, float * instances);
46 void create_atom_lists (gboolean to_pick);
47
48 ColRGBA get_atom_color (int i, int j, double al, int picked, gboolean to_pick);
49
50 object_3d * draw_sphere (int quality);
51
52*/
53
54#include "global.h"
55#include "glview.h"
56#include "ogl_shading.h"
57#include "dlp_field.h"
58#include "preferences.h"
59
61int gColorID[3];
63
75ColRGBA get_atom_color (int i, int j, double al, int picked, gboolean to_pick)
76{
77 // i = atom spec, j = atom id (for coordination maps), al = alpha
78 int s = i;
79 int m;
80 ColRGBA colo;
81 if (to_pick)
82 {
83 gColorID[0]++;
84 if(gColorID[0] > 255)
85 {
86 gColorID[0] = 0;
87 gColorID[1]++;
88 if(gColorID[1] > 255)
89 {
90 gColorID[1] = 0;
91 gColorID[2]++;
92 }
93 }
94 wingl -> color_to_pick[wingl -> to_be_picked] = gColorID[0] + 256*gColorID[1] + 256*256*gColorID[2];
95 colo.red = gColorID[0]/255.0;
96 colo.green = gColorID[1]/255.0;
97 colo.blue = gColorID[2]/255.0;
98 colo.alpha = 1.0;
99 wingl -> to_be_picked ++;
100 }
101 else if (picked)
102 {
103 if (field_color)
104 {
105 colo = init_color (proj_gl -> atoms[step][j].coord[4], num_field_objects);
106 colo.alpha = DEFAULT_OPACITY*0.75;
107 }
108 else
109 {
110 colo = plot -> sel_color[(picked == 1) ? 0 : 1];
111 }
112 }
113 else
114 {
115 if (acolorm == 0)
116 {
117 colo.red = plot -> at_color[s].red;
118 colo.green = plot -> at_color[s].green;
119 colo.blue = plot -> at_color[s].blue;
120 colo.alpha = al;// * plot -> m_terial.param[5];
121 }
122 else if (acolorm < 5)
123 {
124 if (acolorm < 3)
125 {
126 s -= proj_sp*(s/proj_sp);
127 }
128 else
129 {
130 s = 0;
131 }
132 int k = proj_gl -> atoms[step][j].coord[acolorm -1];
133 colo.red = plot -> spcolor[acolorm - 1][s][k].red;
134 colo.green = plot -> spcolor[acolorm - 1][s][k].green;
135 colo.blue = plot -> spcolor[acolorm - 1][s][k].blue;
136 colo.alpha = al;// * plot -> m_terial.param[5];
137 }
138 else if (acolorm == 5)
139 {
141 if (fmol)
142 {
143 s = proj_gl -> atoms[0][j].fid;
144 m = fmol -> mol -> natoms;
145 }
146 else
147 {
148 s = 0;
149 m = 1;
150 }
151 colo = init_color (s, m);
152 colo.alpha = al;// * plot -> m_terial.param[5];
153 }
154 else if (acolorm == 6)
155 {
156 colo.red = wingl -> custom_map -> colors[step][j].red;
157 colo.blue = wingl -> custom_map -> colors[step][j].blue;
158 colo.green = wingl -> custom_map -> colors[step][j].green;
159 colo.alpha = wingl -> custom_map -> colors[step][j].alpha;
160 }
161 }
162 return colo;
163}
164
165int nbs, nbl, nba;
166
175{
176 return qual * qual;
177}
178
187{
188 return 2 * qual * (qual - 1);
189}
190
198object_3d * draw_sphere (int quality)
199{
200 float theta, phi;
201 float cos_phi, sin_phi;
202 float xPos, yPos, zPos;
203 int stack, slice;
204 int x, y, z;
205
206 object_3d * new_sphere = g_malloc0(sizeof*new_sphere);
207 new_sphere -> quality = quality;
208 new_sphere -> num_vertices = sphere_vertices (quality);
209 new_sphere -> vert_buffer_size = 3;
210 new_sphere -> vertices = allocfloat (3*new_sphere -> num_vertices);
211 new_sphere -> num_indices = sphere_indices (quality);
212 new_sphere -> ind_buffer_size = 1;
213 new_sphere -> indices = allocint (new_sphere -> num_indices);
214 x = 0;
215 for (stack=0; stack <= quality-1; stack++)
216 {
217 phi = pi * stack / (quality-1);
218 cos_phi = cos(phi);
219 sin_phi = sin(phi);
220 for (slice=0; slice <= quality-1; slice++)
221 {
222 theta = 2.0 * pi * slice / (quality-1);
223 xPos = cos(theta) * sin_phi;
224 yPos = cos_phi;
225 zPos = sin(theta) * sin_phi;
226 new_sphere -> vertices[3*x] = xPos;
227 new_sphere -> vertices[3*x+1] = yPos;
228 new_sphere -> vertices[3*x+2] = zPos;
229 x ++;
230 }
231 }
232
233 gboolean oddRow = FALSE;
234 z = 0;
235 for (y = 0; y < quality-1; y++)
236 {
237 if (!oddRow) // even rows: y == 0, y == 2; and so on
238 {
239 for (x = 0; x <= quality-1; x++)
240 {
241 new_sphere -> indices[z] = (y * quality + x);
242 new_sphere -> indices[z+1]= ((y + 1) * quality + x);
243 z += 2;
244 }
245 }
246 else
247 {
248 for (x = quality-1; x >= 0; x--)
249 {
250 new_sphere -> indices[z] = ((y + 1) * quality + x);
251 new_sphere -> indices[z+1] = (y * quality + x);
252 z += 2;
253 }
254 }
255 oddRow = !oddRow;
256 }
257 return new_sphere;
258}
259
274{
275 object_3d * quad = g_malloc0(sizeof*quad);
276 quad -> quality = 1;
277 quad -> num_vertices = 4;
278 quad -> vert_buffer_size = 3;
279 quad -> vertices = allocfloat (3 * 4);
280 /* corners: (-1,-1,0), (-1,+1,0), (+1,-1,0), (+1,+1,0) */
281 quad -> vertices[0] = -1.0f; quad -> vertices[1] = -1.0f; quad -> vertices[2] = 0.0f;
282 quad -> vertices[3] = -1.0f; quad -> vertices[4] = 1.0f; quad -> vertices[5] = 0.0f;
283 quad -> vertices[6] = 1.0f; quad -> vertices[7] = -1.0f; quad -> vertices[8] = 0.0f;
284 quad -> vertices[9] = 1.0f; quad -> vertices[10] = 1.0f; quad -> vertices[11] = 0.0f;
285 quad -> num_indices = 4;
286 quad -> ind_buffer_size = 1;
287 quad -> indices = allocint (4);
288 quad -> indices[0] = 0;
289 quad -> indices[1] = 1;
290 quad -> indices[2] = 2;
291 quad -> indices[3] = 3;
292 return quad;
293}
294
305float get_sphere_radius (int style, int sp, int ac, int sel)
306{
307 int spec = (sp > proj_sp-1) ? sp - proj_sp : sp;
308 if (style >= OGL_STYLES)
309 {
310 int fid = get_filled_id(style);
311 int k = (fid) ? 9 + fid : 2;
312 int l = (fid) ? 12 + fid : 7;
313 int m = (int)proj_gl -> chemistry -> chem_prop[CHEM_Z][spec];
314 return (default_o_at_rs[2+5*ac]) ? default_at_rs[2+5*ac] + sel*0.05 : get_radius (2+5*ac, fid, m, default_atomic_rad[(ac) ? l : k]) + sel*0.05;
315 }
316 else if (style == WIREFRAME || style == PUNT)
317 {
318 return plot -> pointrad[spec + ac*proj_sp] + sel*4.0;
319 }
320 else if (style == SPACEFILL)
321 {
322 return plot -> atomicrad[spec + ac*proj_sp] + sel*0.05;
323 }
324 else if (style == CYLINDERS)
325 {
326 return plot -> radall[ac] + sel*0.05;
327 }
328 else
329 {
330 return plot -> sphererad[spec + ac*proj_sp] + sel*0.05;
331 }
332}
333
345void setup_sphere_vertice (float * vertices, vec3_t pos, ColRGBA col, float rad, float alpha)
346{
347 int l;
349 vertices[l] = pos.x;
350 vertices[l+1] = pos.y;
351 vertices[l+2] = pos.z;
352 vertices[l+3] = rad;
353 vertices[l+4] = col.red;
354 vertices[l+5] = col.green;
355 vertices[l+6] = col.blue;
356 vertices[l+7] = col.alpha * alpha;
357 nbl ++;
358}
359
373void setup_this_atom (int style, gboolean to_pick, gboolean picked, atom * at, int ac, float * vert, float al)
374{
375 int i, j, k;
376 float alpha = 1.0;
377 float shift[3];
378 ColRGBA col = get_atom_color (at -> sp, at -> id, 1.0, picked, to_pick);
379 if (at -> sp > proj_sp - 1) at -> sp -= proj_sp;
380 float rad = get_sphere_radius ((style == NONE) ? plot -> style : style, at -> sp, ac, (picked) ? 1 : 0);
381 for (i=0; i<plot -> abc -> extra_cell[0]+1;i++)
382 {
383 for (j=0; j<plot -> abc -> extra_cell[1]+1; j++)
384 {
385 for (k=0; k<plot -> abc -> extra_cell[2]+1; k++)
386 {
387 shift[0]=i*box_gl -> vect[0][0]+j*box_gl -> vect[1][0]+k*box_gl -> vect[2][0];
388 shift[1]=i*box_gl -> vect[0][1]+j*box_gl -> vect[1][1]+k*box_gl -> vect[2][1];
389 shift[2]=i*box_gl -> vect[0][2]+j*box_gl -> vect[1][2]+k*box_gl -> vect[2][2];
390 at_shift (at, shift);
391 setup_sphere_vertice (vert, vec3(at -> x, at -> y, at -> z), col, rad, (to_pick) ? 1.0 : alpha*al);
392 at_unshift (at, shift);
393 alpha = 0.5;
394 }
395 }
396 }
397}
398
406int find_atom_vertices (gboolean to_pick)
407{
408 int i, j;
409 j = 0;
410 for (i=0; i<proj_at; i++)
411 {
412 if (in_movie_encoding && plot -> at_data != NULL)
413 {
414 if (plot -> at_data[i].show[0])
415 {
416 if (to_pick)
417 {
418 all_styles[0] ++;
419 }
420 else
421 {
422 all_styles[plot -> at_data[i].style + 1] ++;
423 }
424 j ++;
425 }
426 }
427 else
428 {
429 if (proj_gl -> atoms[step][i].show[0])
430 {
431 if (to_pick)
432 {
433 all_styles[0] ++;
434 }
435 else
436 {
437 all_styles[proj_gl -> atoms[step][i].style + 1] ++;
438 }
439 j ++;
440 }
441 }
442 }
443 return j;
444}
445
455void setup_atom_vertices (int style, gboolean to_pick, float * vertices)
456{
457 int i;
458 atom * tmp_a;
459 for (i=0; i<proj_at; i++)
460 {
462 if (in_movie_encoding && plot -> at_data != NULL)
463 {
464 tmp_a -> show[0] = plot -> at_data[i].show[0];
465 tmp_a -> style = plot -> at_data[i].style;
466 }
467 if (tmp_a -> show[0] && (tmp_a -> style == style || to_pick))
468 {
469 setup_this_atom (style, to_pick, 0, tmp_a, 0, vertices, 1.0);
470 }
472 }
473}
474
490void prepare_clone (int style, gboolean to_pick, int picked, atom at, atom bt, float x, float y, float z, float * vertices)
491{
492 atom * tmp_a = duplicate_atom (& bt);
493 tmp_a -> x += x;
494 tmp_a -> y += y;
495 tmp_a -> z += z;
496 tmp_a -> id = at.id;
497 tmp_a -> sp = at.sp + proj_sp;
498 int sty = at.style;
499 if (in_movie_encoding && plot -> at_data != NULL)
500 {
501 tmp_a -> show[1] = plot -> at_data[at.id].show[1];
502 sty = plot -> at_data[at.id].style;
503 }
504 if (at.show[1] && (sty == style || to_pick))
505 {
506 setup_this_atom (style, to_pick, picked, tmp_a, 1, vertices, 0.5);
507 }
509}
510
518int find_clone_vertices (gboolean to_pick)
519{
520 int i, j, k, l;
521 l = 0;
522 for (i=0; i < wingl -> bonds[step][1]; i++)
523 {
524 j = wingl -> bondid[step][1][i][0];
525 k = wingl -> bondid[step][1][i][1];
526 if (in_movie_encoding && plot -> at_data != NULL)
527 {
528 if (plot -> at_data[j].show[1])
529 {
530 if (to_pick)
531 {
532 all_styles[0] ++;
533 }
534 else
535 {
536 all_styles[plot -> at_data[j].style + 1] ++;
537 }
538 l++;
539 }
540 if (plot -> at_data[k].show[1])
541 {
542 if (to_pick)
543 {
544 all_styles[0] ++;
545 }
546 else
547 {
548 all_styles[plot -> at_data[k].style + 1] ++;
549 }
550 l++;
551 }
552 }
553 else
554 {
555 if (proj_gl -> atoms[step][j].show[1])
556 {
557 if (to_pick)
558 {
559 all_styles[0] ++;
560 }
561 else
562 {
563 all_styles[proj_gl -> atoms[step][j].style + 1] ++;
564 }
565 l ++;
566 }
567 if (proj_gl -> atoms[step][k].show[1])
568 {
569 if (to_pick)
570 {
571 all_styles[0] ++;
572 }
573 else
574 {
575 all_styles[proj_gl -> atoms[step][k].style + 1] ++;
576 }
577 l ++;
578 }
579 }
580 }
581 return l;
582}
583
593void setup_clone_vertices (int style, gboolean to_pick, float * vertices)
594{
595 int i, j, k;
596 for (i=0; i < wingl -> bonds[step][1]; i++)
597 {
598 j = wingl -> bondid[step][1][i][0];
599 k = wingl -> bondid[step][1][i][1];
600 prepare_clone (style, to_pick, 0,
601 proj_gl -> atoms[step][j],
602 proj_gl -> atoms[step][k],
603 wingl -> clones[step][i].x,
604 wingl -> clones[step][i].y,
605 wingl -> clones[step][i].z, vertices);
606 prepare_clone (style, to_pick, 0,
607 proj_gl -> atoms[step][k],
608 proj_gl -> atoms[step][j],
609 -wingl -> clones[step][i].x,
610 -wingl -> clones[step][i].y,
611 -wingl -> clones[step][i].z, vertices);
612
613 }
614}
615
625void atom_positions_colors_and_sizes (int style, gboolean to_pick, float * instances)
626{
627 setup_atom_vertices (style, to_pick, instances);
628 if (to_pick) wingl -> atoms_to_be_picked = wingl -> clones_to_be_picked = wingl -> to_be_picked;
629 if (plot -> draw_clones)
630 {
631 setup_clone_vertices (style, to_pick, instances);
632 if (to_pick) wingl -> clones_to_be_picked = wingl -> to_be_picked;
633 }
634}
635
643void create_atom_lists (gboolean to_pick)
644{
645 int i, j, k;
646 object_3d * atos;
647 gboolean sphere = TRUE;
648
649 if (! to_pick)
650 {
652 wingl -> create_shaders[ATOMS] = FALSE;
653 }
654
655 for (i=0; i<NUM_STYLES; i++) all_styles[i] = 0;
656 j = find_atom_vertices (to_pick);
657 if (plot -> draw_clones) j += find_clone_vertices (to_pick);
658#ifdef DEBUG
659 g_debug ("Atom LIST:: to_pick= %s, Atom(s) to render= %d", (to_pick) ? "true" : "false", j);
660#endif
661 if (j > 0)
662 {
663 // Render atom(s)
664 j = (plot -> abc -> extra_cell[0]+1)*(plot -> abc -> extra_cell[1]+1)*(plot -> abc -> extra_cell[2]+1);
665 if (! to_pick)
666 {
667 wingl -> n_shaders[ATOMS][step] = 0;
668 for (i=0; i<NUM_STYLES; i++) if (all_styles[i]) wingl -> n_shaders[ATOMS][step] ++;
669 wingl -> ogl_glsl[ATOMS][step] = g_malloc0(wingl -> n_shaders[ATOMS][step]*sizeof*wingl -> ogl_glsl[ATOMS][step]);
670 }
671 k = 0;
672 for (i=0; i<NUM_STYLES; i++)
673 {
674 sphere = TRUE;
675 if (all_styles[i] || to_pick)
676 {
677 if (! i)
678 {
679 if (plot -> style == WIREFRAME || plot -> style == PUNT) sphere = FALSE;
680 }
681 else
682 {
683 if (i-1 == WIREFRAME || i-1 == PUNT) sphere = FALSE;
684 }
685 if (sphere)
686 {
687 /* Ray: billboard quad proxy; classic: tessellated sphere */
688 atos = plot -> ray_tracing ? draw_billboard_quad () : draw_sphere (plot -> quality);
689 }
690 else
691 {
692 atos = g_malloc0(sizeof*atos);
693 atos -> vert_buffer_size = 3;
694 atos -> num_vertices = 1;
695 atos -> vertices = allocfloat (3);
696 atos -> vertices[0] = atos -> vertices[1] = atos -> vertices[2] = 0.0;
697 }
698 atos -> num_instances = j*all_styles[i];
699 atos -> inst_buffer_size = ATOM_BUFF_SIZE;
700 allocate_instances (atos);
701 nbl = 0;
702 atom_positions_colors_and_sizes (i-1, to_pick, atos -> instances);
703 if (! to_pick)
704 {
705 if (sphere)
706 {
707 const GLchar * vs_atom = (plot -> ray_tracing) ? sphere_vertex_ray : sphere_vertex;
708 const GLchar * fs_atom = (plot -> ray_tracing) ? full_color_ray : full_color;
709 wingl -> ogl_glsl[ATOMS][step][k] = init_shader_program (ATOMS, GLSL_SPHERES, vs_atom, NULL, fs_atom, GL_TRIANGLE_STRIP, 4, 1, TRUE, atos);
710 }
711 else
712 {
713 wingl -> ogl_glsl[ATOMS][step][k] = init_shader_program (ATOMS, GLSL_POINTS, point_vertex, NULL, point_color, GL_POINTS, 4, 1, FALSE, atos);
714 }
715 }
716 else
717 {
718 wingl -> ogl_glsl[PICKS][0][0] = init_shader_program (PICKS, GLSL_SPHERES, sphere_vertex, NULL, full_color, GL_TRIANGLE_STRIP, 4, 1, FALSE, atos);
719 }
720 k ++;
721 }
722 if (to_pick) break;
723 }
724 }
725}
insertion_menu mol[]
Definition w_library.c:193
integer(kind=c_int) function chemistry()
Definition chemistry.F90:22
ColRGBA init_color(int id, int numid)
initialize color based id number over total number of elements
Definition initcoord.c:81
int nba
Definition d_atoms.c:165
void atom_positions_colors_and_sizes(int style, gboolean to_pick, float *instances)
find atom(s) position(s), color(s) and prepare the data for the OpenGL rendering
Definition d_atoms.c:625
int gColorID[3]
Definition d_atoms.c:61
int all_styles[NUM_STYLES]
Definition d_atoms.c:62
int sphere_indices(int qual)
return the number of OpenGL indices to render a sphere
Definition d_atoms.c:186
void setup_this_atom(int style, gboolean to_pick, gboolean picked, atom *at, int ac, float *vert, float al)
prepare the OpenGL rendering data of an atom / clone
Definition d_atoms.c:373
object_3d * draw_sphere(int quality)
OpenGL 3D sphere object rendering.
Definition d_atoms.c:198
float get_sphere_radius(int style, int sp, int ac, int sel)
get an atom sphere radius
Definition d_atoms.c:305
void setup_sphere_vertice(float *vertices, vec3_t pos, ColRGBA col, float rad, float alpha)
fill the OpenGL data buffer for a atom (or clone) to render
Definition d_atoms.c:345
void setup_atom_vertices(int style, gboolean to_pick, float *vertices)
prepare an atom OpenGL rendering
Definition d_atoms.c:455
int nbs
Definition d_atoms.c:165
object_3d * draw_billboard_quad()
create a camera-aligned billboard quad proxy for perfect impostors.
Definition d_atoms.c:273
int atom_id
Definition d_atoms.c:60
void setup_clone_vertices(int style, gboolean to_pick, float *vertices)
find clone(s) position(s), color(s) and prepare the data for the OpenGL rendering
Definition d_atoms.c:593
int nbl
Definition d_atoms.c:165
int sphere_vertices(int qual)
return the number of OpenGL vertices to render a sphere
Definition d_atoms.c:174
void create_atom_lists(gboolean to_pick)
prepare atom(s) and clone(s) OpenGL rendering
Definition d_atoms.c:643
ColRGBA get_atom_color(int i, int j, double al, int picked, gboolean to_pick)
get atom (or clone) color
Definition d_atoms.c:75
void prepare_clone(int style, gboolean to_pick, int picked, atom at, atom bt, float x, float y, float z, float *vertices)
prepare the rendering data of a clone
Definition d_atoms.c:490
int find_clone_vertices(gboolean to_pick)
find the number of clones to render
Definition d_atoms.c:518
int find_atom_vertices(gboolean to_pick)
find the number of atom(s) to render
Definition d_atoms.c:406
ColRGBA col
Definition d_measures.c:77
atom_in_selection * tmp_a
Definition d_measures.c:69
int * shift
Definition d_measures.c:72
int atoms[NUM_STYLES][2]
int bonds[NUM_STYLES][2]
GtkTreeSelection * sel
Definition datab.c:102
field_molecule * get_active_field_molecule_from_model_id(project *this_proj, int aid)
retrieve field molecule from overall atom id in the model
Definition dlp_active.c:59
int num_field_objects
Definition dlp_field.c:1071
gboolean field_color
Definition dlp_field.c:1070
Variable declarations for the creation of the DL_POLY input file(s).
double pi
Definition global.c:202
gboolean in_movie_encoding
Definition global.c:184
int * allocint(int val)
allocate an int * pointer
Definition global.c:301
float * allocfloat(int val)
allocate a float * pointer
Definition global.c:385
Global variable declarations Global convenience function declarations Global data structure defin...
#define CHEM_Z
Definition global.h:316
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
image * plot
Definition ogl_draw.c:72
int get_filled_id(int sid)
retrieve filled ID number in FILLED_STYLES based on style ID
Definition m_style.c:184
void at_unshift(atom *at, float *shift)
correct atomic coordinates modified to display image in cell replica
Definition ogl_draw.c:514
project * proj_gl
Definition ogl_draw.c:66
glwin * wingl
Definition ogl_draw.c:65
int proj_sp
Definition ogl_draw.c:67
void at_shift(atom *at, float *shift)
modify atomic coordinates to display image in cell replica
Definition ogl_draw.c:499
#define DEFAULT_OPACITY
Default OpenGL opacity.
Definition glview.h:75
box_info * box_gl
Definition ogl_draw.c:70
void cleaning_shaders(glwin *view, int shader)
re-initialize an OpenGL shader
int qual
Definition ogl_draw.c:73
atom * free_atom(atom *at)
free an atom data structure
Definition ogl_draw.c:484
#define NUM_STYLES
Definition glview.h:177
int step
Definition ogl_draw.c:76
int acolorm
Definition ogl_draw.c:74
atom * duplicate_atom(atom *at)
copy (partially) an atom data structure
Definition ogl_draw.c:449
glsl_program * init_shader_program(int object, int object_id, const GLchar *vertex, const GLchar *geometry, const GLchar *fragment, GLenum type_of_vertices, int narray, int nunif, gboolean lightning, object_3d *obj)
create an OpenGL shader program
int proj_at
Definition ogl_draw.c:68
@ SPACEFILL
Definition glview.h:184
@ CYLINDERS
Definition glview.h:186
@ WIREFRAME
Definition glview.h:183
@ NONE
Definition glview.h:181
@ PUNT
Definition glview.h:187
#define OGL_STYLES
Definition glwin.h:107
@ PICKS
Definition glwin.h:97
@ ATOMS
Definition glwin.h:89
double z
Definition ogl_draw.c:63
double y
Definition ogl_draw.c:63
double x
Definition ogl_draw.c:63
const GLchar * full_color
const GLchar * full_color_ray
const GLchar * sphere_vertex
const GLchar * point_vertex
Definition ogl_shaders.c:50
const GLchar * point_color
Definition ogl_shaders.c:66
const GLchar * sphere_vertex_ray
void allocate_instances(object_3d *object)
allocate the instances buffer of a 3D object
Variable declarations related to GLSL programs Data structure declarations related to GLSL programs...
#define ATOM_BUFF_SIZE
Definition ogl_shading.h:53
@ GLSL_POINTS
Definition ogl_shading.h:38
@ GLSL_SPHERES
Definition ogl_shading.h:39
double * default_at_rs
float get_radius(int object, int col, int z, element_radius *rad_list)
retrieve the radius/width of a species depending on style
gboolean * default_o_at_rs
element_radius * default_atomic_rad[16]
Preference variable declarations.
float blue
Definition global.h:138
float alpha
Definition global.h:139
float red
Definition global.h:136
float green
Definition global.h:137
Definition global.h:964
int sp
Definition global.h:966
int id
Definition global.h:965
int style
Definition global.h:1004
gboolean show[2]
Definition global.h:1000
float y
Definition math_3d.h:130
float x
Definition math_3d.h:130
float z
Definition math_3d.h:130