99 wingl -> to_be_picked ++;
110 colo =
plot -> sel_color[(picked == 1) ? 0 : 1];
117 colo.
red =
plot -> at_color[s].red;
119 colo.
blue =
plot -> at_color[s].blue;
144 m = fmol ->
mol -> natoms;
201 float cos_phi, sin_phi;
202 float xPos, yPos, zPos;
206 object_3d * new_sphere = g_malloc0 (
sizeof*new_sphere);
207 new_sphere -> quality = quality;
209 new_sphere -> vert_buffer_size = 3;
210 new_sphere -> vertices =
allocfloat (3*new_sphere -> num_vertices);
212 new_sphere -> ind_buffer_size = 1;
213 new_sphere -> indices =
allocint (new_sphere -> num_indices);
215 for (stack=0; stack <= quality-1; stack++)
217 phi =
pi * stack / (quality-1);
220 for (slice=0; slice <= quality-1; slice++)
222 theta = 2.0 *
pi * slice / (quality-1);
223 xPos = cos(theta) * sin_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;
233 gboolean oddRow = FALSE;
235 for (
y = 0;
y < quality-1;
y++)
239 for (
x = 0;
x <= quality-1;
x++)
241 new_sphere -> indices[
z] = (
y * quality +
x);
242 new_sphere -> indices[
z+1]= ((
y + 1) * quality +
x);
248 for (
x = quality-1;
x >= 0;
x--)
250 new_sphere -> indices[
z] = ((
y + 1) * quality +
x);
251 new_sphere -> indices[
z+1] = (
y * quality +
x);
282 return plot -> radall[ac] +
sel*0.1;
306 vertices[l+1] = pos.
y;
307 vertices[l+2] = pos.
z;
337 for (i=0; i<
plot -> abc -> extra_cell[0]+1;i++)
339 for (j=0; j<
plot -> abc -> extra_cell[1]+1; j++)
341 for (k=0; k<
plot -> abc -> extra_cell[2]+1; k++)
370 if (
plot -> at_data[i].show[0])
420 tmp_a -> show[0] =
plot -> at_data[i].show[0];
423 if (
tmp_a -> show[0] && (
tmp_a -> style == style || to_pick))
460 if (at.
show[1] && (sty == style || to_pick))
484 if (
plot -> at_data[j].show[1])
496 if (
plot -> at_data[k].show[1])
584 if (to_pick)
wingl -> atoms_to_be_picked =
wingl -> clones_to_be_picked =
wingl -> to_be_picked;
585 if (
plot -> draw_clones)
588 if (to_pick)
wingl -> clones_to_be_picked =
wingl -> to_be_picked;
603 gboolean sphere = TRUE;
615 g_debug (
"Atom LIST:: to_pick= %s, Atom(s) to render= %d", (to_pick) ?
"true" :
"false", j);
620 j = (
plot -> abc -> extra_cell[0]+1)*(
plot -> abc -> extra_cell[1]+1)*(
plot -> abc -> extra_cell[2]+1);
647 atos = g_malloc0 (
sizeof*atos);
648 atos -> vert_buffer_size = 3;
649 atos -> num_vertices = 1;
651 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...
Preference variable declarations.