101 g_debug (
"*** Print Matrices ***");
103 g_debug (
":: MODEL_MATRIX");
104 m4_print (
wingl -> model_matrix);
106 g_debug (
":: VIEW_MATRIX");
107 m4_print (
wingl -> view_matrix);
109 g_debug (
":: MODEL_VIEW_MATRIX");
110 m4_print (
wingl -> model_view_matrix);
112 g_debug (
":: NORMAL_MATRIX");
113 m4_print (
wingl -> normal_matrix);
115 g_debug (
":: PROJECTION_MATRIX");
116 m4_print (
wingl -> projection_matrix);
118 g_debug (
":: PROJECTION_MODEL_VIEW_MATRIX");
119 m4_print (
wingl -> proj_model_view_matrix);
131 wingl -> proj_model_matrix = m4_mul (
wingl -> projection_matrix,
wingl -> model_matrix);
132 wingl -> view_matrix = m4_quat_rotation (
plot -> rotation_quaternion);
134 quat =
plot -> rotation_quaternion;
136 wingl -> un_view_matrix = m4_quat_rotation (quat);
137 wingl -> model_view_matrix = m4_mul (
wingl -> model_matrix,
wingl -> view_matrix);
138 wingl -> normal_matrix = m4_transpose (m4_invert_affine(
wingl -> model_matrix));
139 wingl -> proj_model_view_matrix = m4_mul (
wingl -> projection_matrix,
wingl -> model_view_matrix);
140 wingl -> proj_view_matrix = m4_mul (
wingl -> projection_matrix,
wingl -> view_matrix);
141 wingl -> view_model_matrix = m4_mul (
wingl -> view_matrix,
wingl -> model_matrix);
153 quat =
plot -> rotation_quaternion;
155 wingl -> model_view_matrix = m4_mul (
wingl -> model_view_matrix, m4_quat_rotation (quat));
168 new_s -> word = g_strdup_printf (
"%s", old_s -> word);
169 new_s ->
col = old_s ->
col;
171 for (i=0; i<3; i++) new_s ->
shift[i] = old_s ->
shift[i];
172 new_s -> num_instances = old_s -> num_instances;
173 new_s -> instances =
duplicate_float (old_s -> num_instances, old_s -> instances);
174 new_s -> prev = NULL;
175 new_s -> last = NULL;
190 new_mat -> predefine = old_mat -> predefine;
191 new_mat -> albedo = old_mat -> albedo;
193 for (i=0; i<6; i++) new_mat ->
param[i] = old_mat ->
param[i];
207 new_fog -> mode = old_fog -> mode;
208 new_fog -> based = old_fog -> based;
209 new_fog -> density = old_fog -> density;
211 for (i=0; i<2; i++) new_fog -> depth[i] = old_fog -> depth[i];
225 new_img -> quality = old_img -> quality;
228 new_img -> l_ghtning.lights = old_img -> l_ghtning.lights;
229 new_img -> l_ghtning.spot =
copy_light_sources (old_img -> l_ghtning.lights, old_img -> l_ghtning.lights, old_img -> l_ghtning.spot);
248 new_lab -> font = g_strdup_printf (
"%s", old_lab -> font);
249 new_lab ->
color = NULL;
251 for (i=0; i<3; i++) new_lab ->
shift[i] = old_lab ->
shift[i];
252 new_lab -> n_colors = old_lab -> n_colors;
253 if (old_lab ->
color != NULL)
257 new_lab -> list = NULL;
258 if (old_lab -> list != NULL)
262 stmp_a = old_lab -> list -> last;
263 stmp_b = new_lab -> list -> last;
264 while (stmp_a -> prev != NULL)
267 stmp_b -> prev -> last = stmp_b -> last;
268 stmp_a = stmp_a -> prev;
269 stmp_b = stmp_b -> prev;
284 image * new_img = g_malloc0(
sizeof*new_img);
287 * new_img = * old_img;
289 new_img -> back = g_malloc0(
sizeof*new_img -> back);
291 new_img -> xyz = g_malloc0(
sizeof*new_img -> xyz);
293 new_img -> abc = g_malloc0(
sizeof*new_img -> abc);
298 new_img -> color_map[i] = old_img -> color_map[i];
299 new_img -> show_atom[i] =
duplicate_bool(j, old_img -> show_atom[i]);
300 new_img -> show_label[i] =
duplicate_bool(j, old_img -> show_label[i]);
306 new_img -> bondrad = g_malloc0(2*j*
sizeof*new_img -> bondrad);
307 new_img -> linerad = g_malloc0(2*j*
sizeof*new_img -> linerad);
309 for (i=0; i<2*j; i++)
317 if (old_img -> show_coord[i])
321 if (i < 2 || (i > 3 && i < 9))
323 if (old_img -> show_poly[i])
328 k = (i < 2) ?
proj_gl -> nspec : 1;
329 if (old_img -> spcolor[i])
331 new_img -> spcolor[i] = g_malloc0(k*
sizeof*new_img -> spcolor[i]);
338 new_img -> at_data = g_malloc0(
proj_gl -> natomes*
sizeof*new_img -> at_data);
339 for (i=0; i<
proj_gl -> natomes; i++)
361 if (
wingl -> ring_max[i])
364 for (j=0; j<
coord_gl -> totcoord[i+4]; j++)
367 for (l=0; l<
wingl -> num_rings[i][
step][k-1]; l++)
369 if (
wingl -> show_rpoly[i][
step][k-1][l]) m++;
374 new_img -> i_rings[i] =
allocdint (m+1, 2);
375 new_img -> i_rings[i][0][0] = m;
377 for (j=0; j<
coord_gl -> totcoord[i+4]; j++)
380 for (l=0; l<
wingl -> num_rings[i][
step][k-1]; l++)
382 if (
wingl -> show_rpoly[i][
step][k-1][l])
384 new_img -> i_rings[i][m][0] = j;
385 new_img -> i_rings[i][m][1] = l;
403 for (k=0; k<
coord_gl -> totcoord[2+i]; k++)
405 new_img -> fm_vol_col[i][j][k] = old_img -> fm_vol_col[i][j][k];
420 snapshot * nextsnap = g_malloc0(
sizeof*nextsnap);
423 if (
wingl -> anim -> frames == 0)
425 wingl -> anim -> first -> prev = NULL;
426 wingl -> anim -> last = nextsnap;
427 wingl -> anim -> last -> prev = NULL;
428 wingl -> anim -> first = nextsnap;
432 wingl -> anim -> last -> next = nextsnap;
433 nextsnap -> prev =
wingl -> anim -> last;
434 wingl -> anim -> last =
wingl -> anim -> last -> next;
435 wingl -> anim -> last ->
img ->
id =
wingl -> anim -> frames;
437 wingl -> anim -> frames ++;
451 atom * bt = g_malloc0(
sizeof*bt);
457 bt -> style = at -> style;
458 bt -> cloned = at -> cloned;
462 bt -> show[i] = at -> show[i];
464 bt -> label[i] = at -> label[i];
468 bt -> coord[i] = at -> coord[i];
470 bt -> numv = at -> numv;
471 bt -> fid = at -> fid;
472 bt -> faid = at -> faid;
473 if (bt -> numv) bt -> vois =
duplicate_int (bt -> numv, at -> vois);
486 if (at -> vois) g_free (at -> vois);
568 if (
plot -> back -> gradient)
wingl -> create_shaders[
BACKG] = TRUE;
578 if (
wingl -> to_pick)
581 glDisable (GL_LIGHTING);
586 glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
590 glEnable (GL_LIGHTING);
599 glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
atom_selection * duplicate_ogl_selection(atom_selection *old_sel)
copy an atom selection
double scale(double axe)
find appropriate major tick spacing based on axis length
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
float * duplicate_float(int num, float *old_val)
copy a list of float
gboolean * duplicate_bool(int num, gboolean *old_val)
copy a list of gboolean
int ** allocdint(int xal, int yal)
allocate an int ** pointer
double * duplicate_double(int num, double *old_val)
copy a list of double
gboolean atomes_render_image
Global variable declarations Global convenience function declarations Global data structure defin...
ColRGBA * duplicate_color(int num, ColRGBA *col)
duplicate a ColRGBA pointer
project * get_project_by_id(int p)
get project pointer using id number
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
void cleaning_shaders(glwin *view, int shader)
re-initialize an OpenGL shader
void draw_vertices(int id)
Draw OpenGL shader program.
screen_string * duplicate_screen_string(screen_string *old_s)
create a copy a screen_string data structure
void create_background_lists()
prepare background OpenGL rendering
atom_selection * duplicate_ogl_selection(atom_selection *old_sel)
copy an atom selection
int create_bond_lists(gboolean to_pick)
prepare bond(s) and clone bond(s) OpenGL rendering
void print_matrices()
print OpenGL matrices
void draw(glwin *view)
main drawing subroutine for the OpenGL window
int create_box_lists(int b_step)
prepare box OpenGL rendering
void at_unshift(atom *at, float *shift)
correct atomic coordinates modified to display image in cell replica
void unrotate_camera()
unrotate OpenGL camera
void duplicate_material(Material *new_mat, Material *old_mat)
duplicate material data
void create_ring_lists()
prepare ring(s) polyhedra OpenGL rendering
void duplicate_screen_label(screen_label *new_lab, screen_label *old_lab)
copy screen_label data structure
image * duplicate_image(image *old_img)
create a copy of an image data structure
void create_slab_lists(project *this_proj)
prepare slab(s) OpenGL rendering
void at_shift(atom *at, float *shift)
modify atomic coordinates to display image in cell replica
void create_light_lists()
prepare light(s) OpenGL rendering
ColRGBA init_color(int id, int numid)
initialize color based id number over total number of elements
void duplicate_material_and_lightning(image *new_img, image *old_img)
copy the material and lightning parameters of an image data structure
void create_volumes_lists()
prepare volume(s) OpenGL rendering
void setup_camera()
setup OpenGL camera
int create_label_lists()
prepare atomic label(s) OpenGL rendering
void update_gl_pick_colors()
Light ** copy_light_sources(int dima, int dimb, Light **old_sp)
create a copy of a list of light sources
int create_pick_lists()
prepare the picking list OpenGL rendering
int create_axis_lists()
prepare axis OpenGL rendering
void duplicate_fog(Fog *new_fog, Fog *old_fog)
duplicate fog data
atom * free_atom(atom *at)
free an atom data structure
void create_poly_lists()
prepare coordination polyhedra(s) OpenGL rendering
atom * duplicate_atom(atom *at)
copy (partially) an atom data structure
void create_atom_lists(gboolean to_pick)
prepare atom(s) and clone(s) OpenGL rendering
int create_selection_lists()
prepare the selected atom(s) and bond(s) OpenGL rendering
void add_image()
add an image to the animation
void create_measures_lists()
prepare measure(s) OpenGL rendering
void duplicate_screen_label(screen_label *new_lab, screen_label *old_lab)
copy screen_label data structure
void duplicate_box_data(box *new_box, box *old_box)
duplicate box_data data structure
void duplicate_background_data(background *new_back, background *old_back)
duplicate background data structure
void duplicate_axis_data(axis *new_axis, axis *old_axis)
duplicate axis_data data structure
Preference variable declarations.