98 wingl -> to_be_picked ++;
128 colo.
red =
plot -> at_color[s].red;
130 colo.
blue =
plot -> at_color[s].blue;
155 m = fmol ->
mol -> natoms;
212 float cos_phi, sin_phi;
213 float xPos, yPos, zPos;
217 object_3d * new_sphere = g_malloc0 (
sizeof*new_sphere);
218 new_sphere -> quality = quality;
220 new_sphere -> vert_buffer_size = 3;
221 new_sphere -> vertices =
allocfloat (3*new_sphere -> num_vertices);
223 new_sphere -> ind_buffer_size = 1;
224 new_sphere -> indices =
allocint (new_sphere -> num_indices);
226 for (stack=0; stack <= quality-1; stack++)
228 phi =
pi * stack / (quality-1);
231 for (slice=0; slice <= quality-1; slice++)
233 theta = 2.0 *
pi * slice / (quality-1);
234 xPos = cos(theta) * sin_phi;
236 zPos = sin(theta) * sin_phi;
237 new_sphere -> vertices[3*
x] = xPos;
238 new_sphere -> vertices[3*
x+1] = yPos;
239 new_sphere -> vertices[3*
x+2] = zPos;
244 gboolean oddRow = FALSE;
246 for (
y = 0;
y < quality-1;
y++)
250 for (
x = 0;
x <= quality-1;
x++)
252 new_sphere -> indices[
z] = (
y * quality +
x);
253 new_sphere -> indices[
z+1]= ((
y + 1) * quality +
x);
259 for (
x = quality-1;
x >= 0;
x--)
261 new_sphere -> indices[
z] = ((
y + 1) * quality +
x);
262 new_sphere -> indices[
z+1] = (
y * quality +
x);
293 return plot -> radall[ac] +
sel*0.05;
317 vertices[l+1] = pos.
y;
318 vertices[l+2] = pos.
z;
348 for (i=0; i<
plot -> extra_cell[0]+1;i++)
350 for (j=0; j<
plot -> extra_cell[1]+1; j++)
352 for (k=0; k<
plot -> extra_cell[2]+1; k++)
381 if (
plot -> at_data[i].show[0])
431 tmp_a -> show[0] =
plot -> at_data[i].show[0];
434 if (
tmp_a -> show[0] && (
tmp_a -> style == style || to_pick))
471 if (at.
show[1] && (sty == style || to_pick))
495 if (
plot -> at_data[j].show[1])
507 if (
plot -> at_data[k].show[1])
595 if (to_pick)
wingl -> atoms_to_be_picked =
wingl -> clones_to_be_picked =
wingl -> to_be_picked;
596 if (
plot -> draw_clones)
599 if (to_pick)
wingl -> clones_to_be_picked =
wingl -> to_be_picked;
614 gboolean sphere = TRUE;
626 g_debug (
"Atom LIST:: to_pick= %s, Atom(s) to render= %d", (to_pick) ?
"true" :
"false", j);
631 j = (
plot -> extra_cell[0]+1)*(
plot -> extra_cell[1]+1)*(
plot -> extra_cell[2]+1);
658 atos = g_malloc0 (
sizeof*atos);
659 atos -> vert_buffer_size = 3;
660 atos -> num_vertices = 1;
662 atos -> vertices[0] = atos -> vertices[1] = atos -> vertices[2] = 0.0;
ColRGBA init_color(int id, int numid)
initialize color based id number over total number of elements
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
int all_styles[NUM_STYLES]
int sphere_indices(int qual)
return the number of OpenGL indices to render a sphere
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
object_3d * draw_sphere(int quality)
OpenGL 3D sphere object rendering.
float get_sphere_radius(int style, int sp, int ac, int sel)
get an atom sphere radius
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
void setup_atom_vertices(int style, gboolean to_pick, float *vertices)
prepare an atom OpenGL rendering
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
int sphere_vertices(int qual)
return the number of OpenGL vertices to render a sphere
void create_atom_lists(gboolean to_pick)
prepare atom(s) and clone(s) OpenGL rendering
ColRGBA get_atom_color(int i, int j, double al, int picked, gboolean to_pick)
get atom (or clone) color
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
int find_clone_vertices(gboolean to_pick)
find the number of clones to render
int find_atom_vertices(gboolean to_pick)
find the number of atom(s) to render
atom_in_selection * tmp_a
field_molecule * get_active_field_molecule_from_model_id(project *this_proj, int aid)
retrieve field molecule from overall atom id in the model
Variable declarations for the creation of the DL_POLY input file(s)
gboolean in_movie_encoding
int * allocint(int val)
allocate an int * pointer
float * allocfloat(int val)
allocate a float * pointer
Global variable declarations Global convenience function declarations Global data structure defin...
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
void at_unshift(atom *at, float *shift)
correct atomic coordinates modified to display image in cell replica
void at_shift(atom *at, float *shift)
modify atomic coordinates to display image in cell replica
#define DEFAULT_OPACITY
Default OpenGL opacity.
void cleaning_shaders(glwin *view, int shader)
re-initialize an OpenGL shader
atom * duplicate_atom(atom *at)
copy (partially) an atom data structure
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
const GLchar * full_color
const GLchar * sphere_vertex
const GLchar * point_vertex
const GLchar * point_color
Variable declarations related to GLSL programs Data structure declarations related to GLSL programs...