atomes 1.1.15
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
glwindow.c File Reference

Functions to create a project OpenGL window. More...

#include "global.h"
#include "project.h"
#include "calc.h"
#include "glview.h"
#include "initcoord.h"
#include "submenus.h"
#include "color_box.h"
+ Include dependency graph for glwindow.c:

Go to the source code of this file.

Functions

G_MODULE_EXPORT void opengl_advanced (GtkWidget *widg, gpointer data)
 create OpenGL rendering advanced window
 
G_MODULE_EXPORT void coord_properties (GtkWidget *widg, gpointer data)
 create the environments configuration window
 
G_MODULE_EXPORT void set_style (GtkWidget *widg, gpointer data)
 set style callback
 
G_MODULE_EXPORT void set_render (GtkWidget *widg, gpointer data)
 set OpenGL rendering mode callback
 
G_MODULE_EXPORT void set_mode (GtkWidget *widg, gpointer data)
 set mouse mode callback
 
void set_sensitive_coord_menu (glwin *view, gboolean status)
 
void set_color_map_sensitive (glwin *view)
 
G_MODULE_EXPORT void set_selection_mode (GtkWidget *widg, gpointer data)
 set selection mode callback
 
gboolean spin (gpointer data)
 spin
 
G_MODULE_EXPORT void spin_stop (GtkButton *but, gpointer data)
 stop spin
 
G_MODULE_EXPORT void spin_go (GtkWidget *widg, gpointer data)
 
void update_menus (glwin *view)
 
G_MODULE_EXPORT void set_box_axis_style (GtkWidget *widg, gpointer data)
 
G_MODULE_EXPORT void window_measures (GtkWidget *widg, gpointer data)
 create the measurements window
 
G_MODULE_EXPORT void window_recorder (GtkWidget *widg, gpointer data)
 create video recorder window
 
void window_encode (glwin *view, gboolean video)
 encoding a movie - creating the dialog
 
GtkWidget * menupoly (glwin *view, int jd, int id, gchar *poln)
 
G_MODULE_EXPORT void set_color_map (GtkWidget *widg, gpointer data)
 set color map callback
 
void prep_all_coord_menus (glwin *view)
 
G_MODULE_EXPORT void set_full_screen (GtkWidget *widg, gpointer data)
 set full screen callback GTK3
 
G_MODULE_EXPORT void to_reset_view (GtkWidget *widg, gpointer data)
 reset view callback - GTK3
 
G_MODULE_EXPORT void add_object (GtkWidget *widg, gpointer data)
 add object call back GTK3
 
G_MODULE_EXPORT void label_unlabel_atoms (GtkWidget *widg, gpointer data)
 label / unlabel a type of atom(s) callback GTK3
 
G_MODULE_EXPORT void select_unselect_atoms (GtkWidget *widg, gpointer data)
 select / unselect a type of atom(s) callback GTK3
 
G_MODULE_EXPORT void remove_the_atoms (GtkWidget *widg, gpointer data)
 remove selected atom(s) callback GTK3
 
G_MODULE_EXPORT void copy_the_atoms (GtkWidget *widg, gpointer data)
 copy selected atom(s) callback GTK3
 
G_MODULE_EXPORT void edit_in_new_project (GtkWidget *widg, gpointer data)
 create new project using selection callback GTK3
 
void save_rotation_quaternion (glwin *view)
 save the rotation quaternion of the last image
 
void rotate_x_y (glwin *view, double angle_x, double angle_y)
 rotate the OpenGL camera
 
void translate (project *this_proj, int status, int axis, vec3_t trans)
 translate
 
G_MODULE_EXPORT void on_create_new_project (GtkWidget *widg, gpointer data)
 create a new project
 
int get_selection_type (glwin *view)
 get selection type
 
GtkWidget * shortcuts_window (int sections, int group_by_section[sections], int groups, int shortcut_by_group[groups], gchar *section_names[sections], gchar *group_names[groups], shortcuts shortcs[])
 Create the shortcuts information window.
 
void update_all_menus (glwin *view, int nats)
 update all menus of the OpenGL window
 
G_MODULE_EXPORT void render_gl_image (GtkWidget *widg, gpointer data)
 render image from the OpenGL window
 
G_MODULE_EXPORT void view_shortcuts (GtkWidget *widg, gpointer data)
 OpenGL window shortcuts callback GTK3.
 
void prepare_opengl_menu_bar (glwin *view)
 update the OpenGL window menu bar
 
void change_color_map (glwin *view, int col)
 change atom / polyhedra color map
 
void set_motion (glwin *view, int axis, int da, int db, gboolean UpDown, GdkModifierType state)
 handle keyboard motion event on the OpenGL window
 
mat4_t insert_projection (glwin *view)
 calculate the insertion projection matrix to insert object in the 3D window
 
vec3_t get_insertion_coordinates (glwin *view)
 get the insertion coordinates to insert object in the 3D window
 
void activate_glwin_action (gchar *action_string, gchar *action_name, glwin *view)
 the keyboard shortcut actions for the OpenGL window
 
void glwin_key_pressed (guint keyval, GdkModifierType state, gpointer data)
 the keyboard shortcut actions for the OpenGL window
 
G_MODULE_EXPORT gboolean on_glwin_key_pressed (GtkEventControllerKey *self, guint keyval, guint keycode, GdkModifierType state, gpointer data)
 keyboard key press event for the OpenGL window GTK4
 
G_MODULE_EXPORT void on_win_realize (GtkWidget *widg, gpointer data)
 realize event for the OpenGL window
 
gboolean create_3d_model (int p, gboolean load)
 
void prep_model (int p)
 prepare, or display, the OpenGL model window
 

Variables

int selected_aspec
 
int is_selected
 
int is_labelled
 
gchar * action_atoms [3]
 
atomic_objectcopied_object = NULL
 
gchar * opengl_section_names [] ={ "General", "Analysis mode", "Edition mode" }
 
int opengl_group_by_section [] = { 5, 4, 3 }
 
gchar * opengl_group_names []
 
int opengl_shortcut_by_group []
 
shortcuts opengl_shortcuts []
 

Detailed Description

Functions to create a project OpenGL window.

Author
Sébastien Le Roux sebas.nosp@m.tien.nosp@m..lero.nosp@m.ux@i.nosp@m.pcms..nosp@m.unis.nosp@m.tra.f.nosp@m.r

Definition in file glwindow.c.

Function Documentation

◆ activate_glwin_action()

void activate_glwin_action ( gchar * action_string,
gchar * action_name,
glwin * view )

the keyboard shortcut actions for the OpenGL window

Parameters
action_stringthe variant string
action_namethe action name
viewthe target glwin

Definition at line 812 of file glwindow.c.

◆ add_object()

G_MODULE_EXPORT void add_object ( GtkWidget * widg,
gpointer data )
extern

add object call back GTK3

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 713 of file popup.c.

◆ change_color_map()

void change_color_map ( glwin * view,
int col )

change atom / polyhedra color map

Parameters
viewthe target glwin
colthe color id

Definition at line 644 of file glwindow.c.

◆ coord_properties()

G_MODULE_EXPORT void coord_properties ( GtkWidget * widg,
gpointer data )
extern

create the environments configuration window

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 1469 of file w_coord.c.

◆ copy_the_atoms()

G_MODULE_EXPORT void copy_the_atoms ( GtkWidget * widg,
gpointer data )
extern

copy selected atom(s) callback GTK3

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 1355 of file popup.c.

◆ create_3d_model()

gboolean create_3d_model ( int p,
gboolean load )

Definition at line 1384 of file glwindow.c.

◆ edit_in_new_project()

G_MODULE_EXPORT void edit_in_new_project ( GtkWidget * widg,
gpointer data )
extern

create new project using selection callback GTK3

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 2192 of file popup.c.

◆ get_insertion_coordinates()

vec3_t get_insertion_coordinates ( glwin * view)

get the insertion coordinates to insert object in the 3D window

Parameters
viewthe target glwin

Definition at line 794 of file glwindow.c.

◆ get_selection_type()

int get_selection_type ( glwin * view)
extern

get selection type

Parameters
viewthe target glwin

Definition at line 83 of file w_measures.c.

◆ glwin_key_pressed()

void glwin_key_pressed ( guint keyval,
GdkModifierType state,
gpointer data )

the keyboard shortcut actions for the OpenGL window

Parameters
keyvalthe key pressed
statethe keyboard modifier
datathe associated data pointer

Definition at line 828 of file glwindow.c.

◆ insert_projection()

mat4_t insert_projection ( glwin * view)

calculate the insertion projection matrix to insert object in the 3D window

Parameters
viewthe target glwin

Definition at line 760 of file glwindow.c.

◆ label_unlabel_atoms()

G_MODULE_EXPORT void label_unlabel_atoms ( GtkWidget * widg,
gpointer data )
extern

label / unlabel a type of atom(s) callback GTK3

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 1503 of file popup.c.

◆ menupoly()

GtkWidget * menupoly ( glwin * view,
int jd,
int id,
gchar * poln )
extern

◆ on_create_new_project()

G_MODULE_EXPORT void on_create_new_project ( GtkWidget * widg,
gpointer data )
extern

create a new project

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 62 of file work_menu.c.

◆ on_glwin_key_pressed()

G_MODULE_EXPORT gboolean on_glwin_key_pressed ( GtkEventControllerKey * self,
guint keyval,
guint keycode,
GdkModifierType state,
gpointer data )

keyboard key press event for the OpenGL window GTK4

Parameters
selfthe GtkEventControllerKey sending the signal
keyvalnumber of times it was pressed
keycodethe key pressed
statethe keyboard modifier
datathe associated data pointer

Definition at line 1313 of file glwindow.c.

◆ on_win_realize()

G_MODULE_EXPORT void on_win_realize ( GtkWidget * widg,
gpointer data )

realize event for the OpenGL window

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 1328 of file glwindow.c.

◆ opengl_advanced()

G_MODULE_EXPORT void opengl_advanced ( GtkWidget * widg,
gpointer data )
extern

create OpenGL rendering advanced window

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 1477 of file w_advance.c.

◆ prep_all_coord_menus()

void prep_all_coord_menus ( glwin * view)
extern

◆ prep_model()

void prep_model ( int p)

prepare, or display, the OpenGL model window

Parameters
pthe project id

Definition at line 1518 of file glwindow.c.

◆ prepare_opengl_menu_bar()

void prepare_opengl_menu_bar ( glwin * view)

update the OpenGL window menu bar

Parameters
viewthe target glwin

Definition at line 600 of file glwindow.c.

◆ remove_the_atoms()

G_MODULE_EXPORT void remove_the_atoms ( GtkWidget * widg,
gpointer data )
extern

remove selected atom(s) callback GTK3

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 1297 of file popup.c.

◆ render_gl_image()

G_MODULE_EXPORT void render_gl_image ( GtkWidget * widg,
gpointer data )

render image from the OpenGL window

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 429 of file glwindow.c.

◆ rotate_x_y()

void rotate_x_y ( glwin * view,
double angle_x,
double angle_y )
extern

rotate the OpenGL camera

Parameters
viewthe target glwin
angle_xcamera angle on x axis
angle_ycamera angle on y axis

Definition at line 1081 of file glview.c.

◆ save_rotation_quaternion()

void save_rotation_quaternion ( glwin * view)
extern

save the rotation quaternion of the last image

Parameters
viewthe target glwin

Definition at line 543 of file glview.c.

◆ select_unselect_atoms()

G_MODULE_EXPORT void select_unselect_atoms ( GtkWidget * widg,
gpointer data )
extern

select / unselect a type of atom(s) callback GTK3

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 1551 of file popup.c.

◆ set_box_axis_style()

G_MODULE_EXPORT void set_box_axis_style ( GtkWidget * widg,
gpointer data )
extern

◆ set_color_map()

G_MODULE_EXPORT void set_color_map ( GtkWidget * widg,
gpointer data )
extern

set color map callback

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 1011 of file m_map.c.

◆ set_color_map_sensitive()

void set_color_map_sensitive ( glwin * view)
extern

◆ set_full_screen()

G_MODULE_EXPORT void set_full_screen ( GtkWidget * widg,
gpointer data )
extern

set full screen callback GTK3

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 229 of file popup.c.

◆ set_mode()

G_MODULE_EXPORT void set_mode ( GtkWidget * widg,
gpointer data )
extern

set mouse mode callback

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 172 of file m_tools.c.

◆ set_motion()

void set_motion ( glwin * view,
int axis,
int da,
int db,
gboolean UpDown,
GdkModifierType state )

handle keyboard motion event on the OpenGL window

Parameters
viewthe target glwin
axisaxis
dadirection (-1/1)
dbzoom out (1) or zoom in (3)
UpDownup or down key motion (TRUE), or else (FALSE)
statekeyboard modifier

Definition at line 701 of file glwindow.c.

◆ set_render()

G_MODULE_EXPORT void set_render ( GtkWidget * widg,
gpointer data )
extern

set OpenGL rendering mode callback

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 56 of file m_render.c.

◆ set_selection_mode()

G_MODULE_EXPORT void set_selection_mode ( GtkWidget * widg,
gpointer data )
extern

set selection mode callback

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 133 of file m_tools.c.

◆ set_sensitive_coord_menu()

void set_sensitive_coord_menu ( glwin * view,
gboolean status )
extern

◆ set_style()

G_MODULE_EXPORT void set_style ( GtkWidget * widg,
gpointer data )
extern

set style callback

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 171 of file m_style.c.

◆ shortcuts_window()

GtkWidget * shortcuts_window ( int sections,
int group_by_section[sections],
int groups,
int shortcut_by_group[groups],
gchar * section_names[sections],
gchar * group_names[groups],
shortcuts shortcs[] )
extern

Create the shortcuts information window.

Parameters
sectionsnumber of shortcut sections
group_by_sectionnumber of group by section
groupsnumber of groups
shortcut_by_groupnumber of shortcuts by group
shortcsshortcuts information

Definition at line 181 of file gui.c.

◆ spin()

gboolean spin ( gpointer data)
extern

spin

Parameters
datathe associated data pointer

Definition at line 56 of file w_spiner.c.

◆ spin_go()

G_MODULE_EXPORT void spin_go ( GtkWidget * widg,
gpointer data )
extern

◆ spin_stop()

G_MODULE_EXPORT void spin_stop ( GtkButton * but,
gpointer data )
extern

stop spin

Parameters
butthe GtkButton sending the signal
datathe associated data pointer

Definition at line 138 of file w_spiner.c.

◆ to_reset_view()

G_MODULE_EXPORT void to_reset_view ( GtkWidget * widg,
gpointer data )
extern

reset view callback - GTK3

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 200 of file m_rep.c.

◆ translate()

void translate ( project * this_proj,
int status,
int axis,
vec3_t trans )
extern

translate

Parameters
this_projthe target project
statusselection status, 0 = non selected atom(s), 1 = selected atom(s), 2 = all atom(s)
axis0 = model, 1 = eye
transtranslation vector

Definition at line 230 of file atom_move.c.

◆ update_all_menus()

void update_all_menus ( glwin * view,
int nats )

update all menus of the OpenGL window

Parameters
viewthe target glwin
natsthe total number of atoms

Definition at line 337 of file glwindow.c.

◆ update_menus()

void update_menus ( glwin * view)
extern

◆ view_shortcuts()

G_MODULE_EXPORT void view_shortcuts ( GtkWidget * widg,
gpointer data )

OpenGL window shortcuts callback GTK3.

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 455 of file glwindow.c.

◆ window_encode()

void window_encode ( glwin * view,
gboolean video )
extern

encoding a movie - creating the dialog

Parameters
viewthe target glwin
videovideo (1) or image (0)

Definition at line 319 of file w_encode.c.

◆ window_measures()

G_MODULE_EXPORT void window_measures ( GtkWidget * widg,
gpointer data )
extern

create the measurements window

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 739 of file w_measures.c.

◆ window_recorder()

G_MODULE_EXPORT void window_recorder ( GtkWidget * widg,
gpointer data )
extern

create video recorder window

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 152 of file w_record.c.

Variable Documentation

◆ action_atoms

gchar* action_atoms[3]
extern

Definition at line 61 of file atom_edit.c.

◆ copied_object

atomic_object* copied_object = NULL

Definition at line 123 of file glwindow.c.

◆ is_labelled

int is_labelled
extern

Definition at line 183 of file popup.c.

◆ is_selected

int is_selected
extern

Definition at line 182 of file popup.c.

◆ opengl_group_by_section

int opengl_group_by_section[] = { 5, 4, 3 }

Definition at line 126 of file glwindow.c.

◆ opengl_group_names

gchar* opengl_group_names[]
Initial value:
={"Styles", "Measures", "Selection mode", "Window management", "Mouse mode",
"Camera rotation", "Camera motion", "Camera spin", "Model interaction",
"Coordinates rotation", "Coordinates translation", "Model interaction"}

Definition at line 127 of file glwindow.c.

◆ opengl_section_names

gchar* opengl_section_names[] ={ "General", "Analysis mode", "Edition mode" }

Definition at line 125 of file glwindow.c.

◆ opengl_shortcut_by_group

int opengl_shortcut_by_group[]
Initial value:
= { 10, 1, 4, 6, 2,
4, 6, 6, 3,
4, 6, 6 }

Definition at line 130 of file glwindow.c.

◆ opengl_shortcuts

shortcuts opengl_shortcuts[]

Definition at line 134 of file glwindow.c.

◆ selected_aspec

int selected_aspec
extern

Definition at line 180 of file popup.c.