81 for (i=1; i <
ta; i++)
85 bt.
x = xyz[0][i-1][0];
86 bt.
y = xyz[0][i-1][1];
87 bt.
z = xyz[0][i-1][2];
89 if (
d.pbc) clones = TRUE;
90 xyz[0][i][0] = xyz[0][i-1][0] +
d.
x;
91 xyz[0][i][1] = xyz[0][i-1][1] +
d.y;
92 xyz[0][i][2] = xyz[0][i-1][2] +
d.z;
108 for (k=0; k<m+1; k++)
131 xyz[m][j][0] = xyz[0][j][0] +
d.
x;
132 xyz[m][j][1] = xyz[0][j][1] +
d.y;
133 xyz[m][j][2] = xyz[0][j][2] +
d.z;
139 if (! go)
return m+1;
143 for (i=0; i<m+1; i++)
146 pcol =
plot -> spcolor[4+se][0][ge];
176 int i, j, k, l, m, n;
178 g_debug (
"Ring LIST");
185 for (i=0; i < 5; i++)
187 nrings[i] = g_malloc0 (
coord_gl -> totcoord[i+4]*
sizeof*nrings[i]);
188 for (j=0; j <
coord_gl -> totcoord[i+4]; j++)
193 if (
plot -> show_poly[i+4][j])
196 for (m = 0; m <
wingl -> num_rings[i][
step][k-1]; m++)
204 for (m=0; m <
wingl -> num_rings[i][
step][k-1]; m++)
206 if (
wingl -> show_rpoly[i][
step][k-1][m])
214 m = (k == 3) ? k+1: k;
216 nrings[i][j] = l*(m*(m-1)*(m-2)/6);
217 rtot += nrings[i][j]*3;
221 for (l=0; l<
plot -> i_rings[i][0][0]; l++)
223 j =
plot -> i_rings[i][l+1][0];
228 n = (k == 3) ? k+1: k;
229 nrings[i][j] += (n*(n-1)*(n-2)/6);
230 rtot += (n*(n-1)*(n-2)/6)*3;
239 object_3d * rings = g_malloc0 (
sizeof*rings);
241 rings -> num_vertices = rtot * (
plot -> extra_cell[0]+1)*(
plot -> extra_cell[1]+1)*(
plot -> extra_cell[2]+1);
242 rings -> vertices =
allocfloat (rings -> vert_buffer_size*rings -> num_vertices);
244 for (i=0; i < 5; i++)
246 for (j=0; j <
coord_gl -> totcoord[i+4]; j++)
251 if (
plot -> show_poly[i+4][j])
253 for (l=0; l <
wingl -> num_rings[i][
step][k-1]; l++)
260 for (l=0; l <
wingl -> num_rings[i][
step][k-1]; l++)
262 if (
wingl -> show_rpoly[i][
step][k-1][l])
272 for (l=0; l<
plot -> i_rings[i][0][0]; l++)
274 j =
plot -> i_rings[i][l+1][0];
Structure definitions for color management Function declarations for color management.
void check_triangles(int s, GLfloat **xyz)
check triangle intersection
void create_ring_lists()
prepare ring(s) polyhedra OpenGL rendering
void get_centroid(GLfloat **xyz, int id)
find the barycenter of a polyhedron
int prepare_rings_gl(float *vertices, int se, int ge, int ta, int id, gboolean go)
prepare a ring polyhedra OpenGL rendering
void setup_tetrahedron(float *vertices, GLfloat **xyz)
fill the OpenGL data buffer for a tetrahedra to render
void setup_polyhedron(float *vertices, GLfloat **xyz, int s)
fill the OpenGL data buffer for a polyhedron to render
distance distance_3d(cell_info *cell, int mdstep, atom *at, atom *bt)
distance between atom a and b in 3D
gboolean in_movie_encoding
float * allocfloat(int val)
allocate a float * pointer
float *** alloctfloat(int xal, int yal, int zal)
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 cleaning_shaders(glwin *view, int shader)
re-initialize an OpenGL shader
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
G_MODULE_EXPORT void cloned_poly(GtkWidget *widg, gpointer data)
cloned polyehdra callback - GTK3
const GLchar * full_color
const GLchar * full_vertex