43#define DEFAULT_STYLE 1
49#define DEFAULT_LIGHTNING 1.00
54#define DEFAULT_METALLIC 0.35
59#define DEFAULT_ROUGHNESS 0.15
64#define DEFAULT_AMBIANT_OCCLUSION 1.00
69#define DEFAULT_GAMMA_CORRECTION 1.50
74#define DEFAULT_OPACITY 1.00
85#define DEFAULT_INTENSITY 10.0
100#define CAMERA_ANGLE_X 5.0
105#define CAMERA_ANGLE_Y -25.0
110#define CAMERA_ANGLE_Z 0.0
120#define ZOOM_FACTOR 0.05
125#define ZOOM_MAX 0.001
135#define MAX_IN_SELECTION 21
139#define COORD_MAX_MENU 20
264extern gboolean
create_bond (
int ac,
int bid,
int ba,
int bb,
int sel,
double length);
284extern void sort (
int dim,
int * tab);
291G_MODULE_EXPORT gboolean on_lib_pressed (GtkWidget * widg, GdkEvent * event, gpointer data);
292G_MODULE_EXPORT gboolean on_glwin_button_event (GtkWidget * widg, GdkEvent * event, gpointer data);
293G_MODULE_EXPORT gboolean on_motion (GtkWidget * widg, GdkEvent * event, gpointer data);
294G_MODULE_EXPORT gboolean on_scrolled (GtkWidget * widg, GdkEvent * event, gpointer data);
296G_MODULE_EXPORT
void on_lib_button_pressed (GtkGesture * gesture,
int n_press,
double x,
double y, gpointer data);
301G_MODULE_EXPORT gboolean
on_glwin_pointer_scoll (GtkEventControllerScroll * event, gdouble dx, gdouble dy, gpointer data);
310 G_MODULE_EXPORT
void on_realize (GtkGLArea * area, gpointer data);
311 G_MODULE_EXPORT gboolean
on_expose (GtkGLArea * area, GdkGLContext * context, gpointer data);
313 G_MODULE_EXPORT
void on_realize (GtkWidget * area, gpointer data);
314 G_MODULE_EXPORT gboolean
on_expose (GtkWidget * widg, cairo_t * cr, gpointer data);
341 const GLchar * vertex,
const GLchar * geometry,
const GLchar * fragment,
342 GLenum type_of_vertices,
int narray,
int nunif, gboolean lightning,
object_3d * obj);
357extern G_MODULE_EXPORT
void show_hide_clones (GtkWidget * widg, gpointer data);
358extern G_MODULE_EXPORT
void set_rep (GtkWidget * widg, gpointer data);
363extern void popup_selection (
glwin * view,
double ptx,
double pty,
int se,
int pe,
int ai,
int bi,
int ac);
void motion(glwin *view, gint x, gint y, GdkModifierType state)
mouse motion in the OpenGL window
angle dihedral_3d(cell_info *cell, int mdstep, atom *at, atom *bt, atom *ct, atom *dt)
dihedral between atom a, b, c and d in 3D
void re_create_all_md_shaders(glwin *view)
re-initialize all MD dependent OpenGL shaders
atom_search * free_this_search_data(atom_search *this_search)
free atom search data structure
GLfloat ** allocdGLfloat(int xal, int yal)
allocate a GLfloat ** pointer
distance distance_2d(atom *at, atom *bt)
distance between atom a and b in 2D
void draw_atom(atom at, double al)
void prepare_cuboid(vec3_t position, int id)
OpenGL 3D light object rendering.
G_MODULE_EXPORT void to_center_this_molecule(GtkWidget *widg, gpointer data)
center this molecule menu item callback GTK4
void draw(glwin *view)
main drawing subroutine for the OpenGL window
void re_create_md_shaders(int nshaders, int shaders[nshaders], project *this_proj)
re-initialize some MD dependent OpenGL shaders
gboolean create_atom(GLUquadricObj *quadric, int aid, int ac, int sp, int sel)
void at_unshift(atom *at, float *shift)
correct atomic coordinates modified to display image in cell replica
void prepare_string(char *text, int id, ColRGBA col, vec3_t pos, float lshift[3], atom *at, atom *bt, atom *ct)
prepare a screen string to be rendered
void update(glwin *view)
update the rendering of the OpenGL window
void init_opengl(glwin *view)
initialize OpenGL rendering parameters for a glwin pointer
gboolean is_coord_in_menu(int id, project *this_proj)
is this coordination in a menu ?
void update_all_menus(glwin *view, int nats)
update all menus of the OpenGL window
int check_label_numbers(project *this_proj, int types)
check how many atom label(s) are visible
void popup_main_menu(glwin *view, double ptx, double pty)
create the OpenGL window popup menu
mat4_t create_axis_matrices(int type)
create axis OpenGL rendering matrices
void init_shaders(glwin *view)
initialize all the OpenGL shaders
angle angle_2d(atom *at, atom *bt, atom *ct)
angle between atom a, b and c in 2D
G_MODULE_EXPORT void show_hide_clones(GSimpleAction *action, GVariant *state, gpointer data)
show/hide clones menu item callback
void draw_cylinder_bond(atom a, atom b, int bid, int ci, int bi)
void at_shift(atom *at, float *shift)
modify atomic coordinates to display image in cell replica
void draw_wireframe_bond(atom a, atom b, int ci, int bi)
void update_selection_list(atom_selection *at_list, atom *at, gboolean add)
update the selection list adding or removing an atom
ColRGBA init_color(int id, int numid)
initialize color based id number over total number of elements
G_MODULE_EXPORT void on_realize(GtkWidget *area, gpointer data)
realize event for the OpenGL widget
G_MODULE_EXPORT void on_lib_button_released(GtkGesture *gesture, int n_press, double x, double y, gpointer data)
handle mouse button release event on the molecular library OpenGL window (limited interaction)
void zoom(glwin *view, int delta)
zoom in or zoom out in the OpenGL window
void draw_rings_gl(int se, int ge, int ta, int id)
G_MODULE_EXPORT void on_lib_button_pressed(GtkGesture *gesture, int n_press, double x, double y, gpointer data)
handle mouse button press event on the molecular library OpenGL window (limited interaction)
G_MODULE_EXPORT void on_glwin_button_released(GtkGesture *gesture, int n_press, double x, double y, gpointer data)
mouse button released signal on the OpenGL window
void popup_selection(glwin *view, double ptx, double pty, int se, int pe, int ai, int bi, int ac)
create the contextual popup menu, right click on atom or bond
void cleaning_shaders(glwin *view, int shader)
re-initialize an OpenGL shader
G_MODULE_EXPORT void on_glwin_button_pressed(GtkGesture *gesture, int n_press, double x, double y, gpointer data)
mouse button pressed signal on the OpenGL window
void init_camera(project *this_proj, gboolean get_depth)
void setup_bonds(glwin *view)
mat4_t create_label_matrices()
create label projection matrices
ColRGBA set_default_color(int z)
pick the default color for an atom
void process_selected_atom(project *this_proj, glwin *view, int id, int ac, int se, int pi)
process selected atom
void draw_vertices(int id)
Draw OpenGL shader program.
void update_selection_tree(glwin *view, int pi, int id)
update measurements tree view
void render_all_strings(int glsl, int id)
render all string to be rendered for a label list
angle angle_3d(cell_info *cell, int mdstep, atom *at, atom *bt, atom *ct)
angle between atom a, b and c in 3D
gboolean create_bond(int ac, int bid, int ba, int bb, int sel, double length)
vec3_t get_insertion_coordinates(glwin *view)
get the insertion coordinates to insert object in the 3D window
void center_this_molecule(glwin *view)
center atomic coordinates around (0,0,0) and refresh shaders
atom * duplicate_atom(atom *at)
copy (partially) an atom data structure
void update_all_selections(glwin *view, int pi)
update the selection data: bonds, angles and dihedrals
void save_all_selections(glwin *view, int pi)
save all selection data
void reshape(glwin *view, int width, int height)
reshape (resize) the OpenGL window
void debug_image(image img, int i)
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
void init_default_shaders(glwin *view)
re-initialize the default OpenGL shaders
G_MODULE_EXPORT gboolean on_glwin_pointer_scoll(GtkEventControllerScroll *event, gdouble dx, gdouble dy, gpointer data)
handle mouse scroll event on the OpenGL window
G_MODULE_EXPORT void on_glwin_pointer_motion(GtkEventControllerMotion *motion, gdouble x, gdouble y, gpointer data)
handle mouse motion event in the OpenGL window GTK4
G_MODULE_EXPORT gboolean on_expose(GtkWidget *widg, cairo_t *cr, gpointer data)
OpenGL rendering widget expose event callback GTK3.
void draw_cylinder_bond_to_pick(atom a, atom b, int bid)
void sort(int dim, int *tab)
sort, nim to max, a table by integer value
void draw_atom_to_pick(atom at)
distance distance_3d(cell_info *cell, int mdstep, atom *at, atom *bt)
distance between atom a and b in 3D
shaders
The different types of shaders in the atomes program.
G_MODULE_EXPORT void set_rep(GtkWidget *widg, gpointer data)
change representation callback - GTK3