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

Variable declarations related to the OpenGL window
Function declarations related to the OpenGL window. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  gl_pop_info
 

Macros

#define QUALITY   30
 Default OpenGL quality (number of polygons)
 
#define DEFAULT_STYLE   1
 Default OpenGL style: ball and stick.
 
#define DEFAULT_SIZE   1
 
#define DEFAULT_LIGHTNING   1.00
 Default OpenGL material ligthning.
 
#define DEFAULT_METALLIC   0.35
 Default OpenGL material metallic.
 
#define DEFAULT_ROUGHNESS   0.15
 Default OpenGL material roughness.
 
#define DEFAULT_AMBIANT_OCCLUSION   1.00
 Default OpenGL material ambiant occlusion.
 
#define DEFAULT_GAMMA_CORRECTION   1.50
 Default OpenGL material gamma correction.
 
#define DEFAULT_OPACITY   1.00
 Default OpenGL opacity.
 
#define MAX_LIGHTS   10
 Maximum number of light sources.
 
#define DEFAULT_INTENSITY   10.0
 Default light intensity.
 
#define NEAR_PLANE   1.0
 Default value for the OpenGL near plane.
 
#define FAR_PLANE   10.0
 Default value for the OpenGL far plane.
 
#define CAMERA_ANGLE_X   5.0
 Default value for the OpenGL camera pitch in °
 
#define CAMERA_ANGLE_Y   -25.0
 Default value for the OpenGL camera heading in °
 
#define CAMERA_ANGLE_Z   0.0
 Default value for the OpenGL camera toll in °
 
#define ZOOM   1.5
 Default value for the OpenGL zoom.
 
#define ZOOM_FACTOR   0.05
 Default value for the OpenGL zoom factor.
 
#define ZOOM_MAX   0.001
 Maximum value for the OpenGL zoom factor.
 
#define REFRESH   10
 Refresh time for spinning the OpenGL window in milliseconds.
 
#define MAX_IN_SELECTION   21
 Maximum number of atoms in selection to display measure information.
 
#define COORD_MAX_MENU   20
 Maximum number of fragments or molecules to build the related menu items.
 
#define NUM_STYLES   7
 

Typedefs

typedef struct gl_pop_info gl_pop_info
 

Enumerations

enum  radii { VDW = 0 , INC = 1 , COV = 2 , ION = 3 }
 
enum  representation { ORTHOGRAPHIC = 0 , PERSPECTIVE = 1 }
 
enum  modes {
  ANALYZE = 0 , EDITION = 1 , MOTION = 2 , DL_POLY = 3 ,
  LAAMPS = 4 , CPMD_AI = 5 , CP2K_AI = 6 , CP2K_QMMM = 7 ,
  CP2K_MM = 8
}
 
enum  styles {
  NONE = -1 , BALL_AND_STICK = 0 , WIREFRAME = 1 , SPACEFILL = 2 ,
  SPHERES = 3 , CYLINDERS = 4 , PUNT = 5
}
 
enum  render { FILL = 0 , LINE = 1 , PTS = 2 }
 
enum  action {
  ROTATE = 0 , MOVE = 1 , SELECT = 2 , ZOOM_IN_OUT = 3 ,
  SPIN = 4
}
 
enum  mouse_status { CLICKED = 0 , RELEASED = 1 }
 
enum  axisposition {
  TOP_RIGHT = 0 , TOP_LEFT = 1 , BOTTOM_RIGHT = 2 , BOTTOM_LEFT = 3 ,
  CENTER = 4 , CUSTOM = 5
}
 
enum  labels {
  ELEMENT_NAME = 0 , SYMBOL = 1 , SYMBOL_AND_NUM = 2 , NUM = 3 ,
  ID_IN_MOLECULE = 4
}
 
enum  actions {
  DISPL = 2 , REPLACE = 3 , REMOVE = 4 , INSERT = 5 ,
  RANMOVE = 6
}
 
enum  texts { SIMPLE_TEXT = 0 , BETTER_TEXT = 1 }
 

Functions

GLfloat ** allocdGLfloat (int xal, int yal)
 allocate a GLfloat ** pointer
 
gboolean create_bond (int ac, int bid, int ba, int bb, int sel, double length)
 
void draw_cylinder_bond (atom a, atom b, int bid, int ci, int bi)
 
void draw_cylinder_bond_to_pick (atom a, atom b, int bid)
 
void draw_wireframe_bond (atom a, atom b, int ci, int bi)
 
gboolean create_atom (GLUquadricObj *quadric, int aid, int ac, int sp, int sel)
 
void draw_vertices (int id)
 Draw OpenGL shader program.
 
void draw_atom_to_pick (atom at)
 
void draw_atom (atom at, double al)
 
void draw_rings_gl (int se, int ge, int ta, int id)
 
void draw_box ()
 
void prepare_cuboid (vec3_t position, int id)
 OpenGL 3D light object rendering.
 
void prepare_axis ()
 
void draw (glwin *view)
 main drawing subroutine for the OpenGL window
 
void render_all_strings (int glsl, int id)
 render all string to be rendered for a label list
 
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
 
ColRGBA init_color (int id, int numid)
 initialize color based id number over total number of elements
 
ColRGBA set_default_color (int z)
 pick the default color for an atom
 
void sort (int dim, int *tab)
 sort, nim to max, a table by integer value
 
vec3_t get_insertion_coordinates (glwin *view)
 get the insertion coordinates to insert object in the 3D window
 
void setup_bonds (glwin *view)
 
void update (glwin *view)
 update the rendering of the OpenGL window
 
void center_this_molecule (glwin *view)
 center atomic coordinates around (0,0,0) and refresh shaders
 
G_MODULE_EXPORT void to_center_this_molecule (GtkWidget *widg, gpointer data)
 center this molecule menu item callback GTK4
 
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_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)
 
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
 
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
 
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_glwin_pointer_scoll (GtkEventControllerScroll *event, gdouble dx, gdouble dy, gpointer data)
 handle mouse scroll event on the OpenGL window
 
void reshape (glwin *view, int width, int height, gboolean use_ratio)
 reshape (resize) the OpenGL window
 
void zoom (glwin *view, int delta)
 zoom in or zoom out in the OpenGL window
 
void init_opengl ()
 initialize OpenGL rendering parameters
 
void init_camera (project *this_proj, gboolean get_depth)
 
G_MODULE_EXPORT void on_realize (GtkWidget *area, gpointer data)
 realize event for the OpenGL widget
 
G_MODULE_EXPORT gboolean on_expose (GtkWidget *widg, cairo_t *cr, gpointer data)
 OpenGL rendering widget expose event callback GTK3.
 
void debug_image (image img, int i)
 
distance distance_2d (atom *at, atom *bt)
 distance between atom a and b in 2D
 
distance distance_3d (cell_info *cell, int mdstep, atom *at, atom *bt)
 distance between atom a and b in 3D
 
angle angle_2d (atom *at, atom *bt, atom *ct)
 angle between atom a, b and c in 2D
 
angle angle_3d (cell_info *cell, int mdstep, atom *at, atom *bt, atom *ct)
 angle between atom a, b and c in 3D
 
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
 
atomduplicate_atom (atom *at)
 copy (partially) an atom data structure
 
void at_shift (atom *at, float *shift)
 modify atomic coordinates to display image in cell replica
 
void at_unshift (atom *at, float *shift)
 correct atomic coordinates modified to display image in cell replica
 
int check_label_numbers (project *this_proj, int types)
 check how many atom label(s) are visible
 
mat4_t create_axis_matrices (int type)
 create axis OpenGL rendering matrices
 
mat4_t create_label_matrices ()
 create label projection matrices
 
void re_create_all_md_shaders (glwin *view)
 re-initialize all MD dependent OpenGL shaders
 
void re_create_md_shaders (int nshaders, int shaders[nshaders], project *this_proj)
 re-initialize some MD dependent OpenGL shaders
 
void cleaning_shaders (glwin *view, int shader)
 re-initialize an OpenGL shader
 
void init_default_shaders (glwin *view)
 re-initialize the default OpenGL shaders
 
void init_shaders (glwin *view)
 initialize all the OpenGL shaders
 
glsl_programinit_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 update_selection_list (atom_selection *at_list, atom *at, gboolean add)
 update the selection list adding or removing an atom
 
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 process_selected_atom (project *this_proj, glwin *view, int id, int ac, int se, int pi)
 process selected atom
 
void update_selection_tree (glwin *view, int pi, int id)
 update measurements tree view
 
void update_all_menus (glwin *view, int nats)
 update all menus of the OpenGL window
 
gboolean is_coord_in_menu (int id, project *this_proj)
 is this coordination in a menu ?
 
atom_searchfree_this_search_data (atom_search *this_search)
 free atom search data structure
 
G_MODULE_EXPORT void show_hide_clones (GSimpleAction *action, GVariant *state, gpointer data)
 show/hide clones menu item callback
 
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 popup_main_menu (glwin *view, double ptx, double pty)
 create the OpenGL window popup menu
 

Variables

GLfloat initlights [4][4]
 
gboolean pick
 
glwinwingl
 
projectproj_gl
 
coord_infocoord_gl
 
box_infobox_gl
 
cell_infocell_gl
 
int proj_sp
 
int proj_at
 
imageplot
 
int qual
 
int acolorm
 
int pcolorm
 
int step
 
int gColorID [3]
 
int field_object
 
GLenum ogl_texture
 
int nbs
 
int nbl
 
int nba
 
gl_pop_info to_pop
 

Detailed Description

Variable declarations related to the OpenGL window
Function declarations related to the 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 glview.h.

Macro Definition Documentation

◆ CAMERA_ANGLE_X

#define CAMERA_ANGLE_X   5.0

Default value for the OpenGL camera pitch in °

Definition at line 100 of file glview.h.

◆ CAMERA_ANGLE_Y

#define CAMERA_ANGLE_Y   -25.0

Default value for the OpenGL camera heading in °

Definition at line 105 of file glview.h.

◆ CAMERA_ANGLE_Z

#define CAMERA_ANGLE_Z   0.0

Default value for the OpenGL camera toll in °

Definition at line 110 of file glview.h.

◆ COORD_MAX_MENU

#define COORD_MAX_MENU   20

Maximum number of fragments or molecules to build the related menu items.

Definition at line 139 of file glview.h.

◆ DEFAULT_AMBIANT_OCCLUSION

#define DEFAULT_AMBIANT_OCCLUSION   1.00

Default OpenGL material ambiant occlusion.

Definition at line 64 of file glview.h.

◆ DEFAULT_GAMMA_CORRECTION

#define DEFAULT_GAMMA_CORRECTION   1.50

Default OpenGL material gamma correction.

Definition at line 69 of file glview.h.

◆ DEFAULT_INTENSITY

#define DEFAULT_INTENSITY   10.0

Default light intensity.

Definition at line 85 of file glview.h.

◆ DEFAULT_LIGHTNING

#define DEFAULT_LIGHTNING   1.00

Default OpenGL material ligthning.

Definition at line 49 of file glview.h.

◆ DEFAULT_METALLIC

#define DEFAULT_METALLIC   0.35

Default OpenGL material metallic.

Definition at line 54 of file glview.h.

◆ DEFAULT_OPACITY

#define DEFAULT_OPACITY   1.00

Default OpenGL opacity.

Definition at line 74 of file glview.h.

◆ DEFAULT_ROUGHNESS

#define DEFAULT_ROUGHNESS   0.15

Default OpenGL material roughness.

Definition at line 59 of file glview.h.

◆ DEFAULT_SIZE

#define DEFAULT_SIZE   1

Definition at line 45 of file glview.h.

◆ DEFAULT_STYLE

#define DEFAULT_STYLE   1

Default OpenGL style: ball and stick.

Definition at line 43 of file glview.h.

◆ FAR_PLANE

#define FAR_PLANE   10.0

Default value for the OpenGL far plane.

Definition at line 95 of file glview.h.

◆ MAX_IN_SELECTION

#define MAX_IN_SELECTION   21

Maximum number of atoms in selection to display measure information.

Definition at line 135 of file glview.h.

◆ MAX_LIGHTS

#define MAX_LIGHTS   10

Maximum number of light sources.

Definition at line 80 of file glview.h.

◆ NEAR_PLANE

#define NEAR_PLANE   1.0

Default value for the OpenGL near plane.

Definition at line 90 of file glview.h.

◆ NUM_STYLES

#define NUM_STYLES   7

Definition at line 168 of file glview.h.

◆ QUALITY

#define QUALITY   30

Default OpenGL quality (number of polygons)

Definition at line 39 of file glview.h.

◆ REFRESH

#define REFRESH   10

Refresh time for spinning the OpenGL window in milliseconds.

Definition at line 130 of file glview.h.

◆ ZOOM

#define ZOOM   1.5

Default value for the OpenGL zoom.

Definition at line 115 of file glview.h.

◆ ZOOM_FACTOR

#define ZOOM_FACTOR   0.05

Default value for the OpenGL zoom factor.

Definition at line 120 of file glview.h.

◆ ZOOM_MAX

#define ZOOM_MAX   0.001

Maximum value for the OpenGL zoom factor.

Definition at line 125 of file glview.h.

Typedef Documentation

◆ gl_pop_info

typedef struct gl_pop_info gl_pop_info

Definition at line 366 of file glview.h.

Enumeration Type Documentation

◆ action

enum action
Enumerator
ROTATE 

0

MOVE 

1

SELECT 

2

ZOOM_IN_OUT 

3

SPIN 

4

Definition at line 189 of file glview.h.

◆ actions

enum actions
Enumerator
DISPL 

2

REPLACE 

3

REMOVE 

4

INSERT 

5

RANMOVE 

6

Definition at line 223 of file glview.h.

◆ axisposition

Enumerator
TOP_RIGHT 

0

TOP_LEFT 

1

BOTTOM_RIGHT 

2

BOTTOM_LEFT 

3

CENTER 

4

CUSTOM 

5

Definition at line 204 of file glview.h.

◆ labels

enum labels
Enumerator
ELEMENT_NAME 

0

SYMBOL 

1

SYMBOL_AND_NUM 

2

NUM 

3

ID_IN_MOLECULE 

4

Definition at line 214 of file glview.h.

◆ modes

enum modes
Enumerator
ANALYZE 

0

EDITION 

1

MOTION 

2

DL_POLY 

3

LAAMPS 

4

CPMD_AI 

5

CP2K_AI 

6

CP2K_QMMM 

7

CP2K_MM 

8

Definition at line 156 of file glview.h.

◆ mouse_status

Enumerator
CLICKED 

0

RELEASED 

1

Definition at line 198 of file glview.h.

◆ radii

enum radii
Enumerator
VDW 

0

INC 

1

COV 

2

ION 

3

Definition at line 142 of file glview.h.

◆ render

enum render
Enumerator
FILL 

0

LINE 

1

PTS 

2

Definition at line 182 of file glview.h.

◆ representation

Enumerator
ORTHOGRAPHIC 

0

PERSPECTIVE 

1

Definition at line 150 of file glview.h.

◆ styles

enum styles
Enumerator
NONE 

-1

BALL_AND_STICK 

0

WIREFRAME 

1

SPACEFILL 

2

SPHERES 

3

CYLINDERS 

4

PUNT 

5

Definition at line 171 of file glview.h.

◆ texts

enum texts
Enumerator
SIMPLE_TEXT 

0

BETTER_TEXT 

1

Definition at line 232 of file glview.h.

Function Documentation

◆ allocdGLfloat()

GLfloat ** allocdGLfloat ( int xal,
int yal )
extern

allocate a GLfloat ** pointer

Parameters
xal1st dimension size of the pointer to allocate
yal2nd dimension size of the pointer to allocate

Definition at line 161 of file glview.c.

◆ angle_2d()

angle angle_2d ( atom * at,
atom * bt,
atom * ct )
extern

angle between atom a, b and c in 2D

Parameters
atatom a
btatom b
ctatom c

Definition at line 156 of file ogl_utils.c.

◆ angle_3d()

angle angle_3d ( cell_info * cell,
int mdstep,
atom * at,
atom * bt,
atom * ct )
extern

angle between atom a, b and c in 3D

Parameters
cellunit cell
mdstepthe MD step
atatom a
btatom b
ctatom c

Definition at line 179 of file ogl_utils.c.

◆ at_shift()

void at_shift ( atom * at,
float * shift )
extern

modify atomic coordinates to display image in cell replica

Parameters
atthe atom
shiftthe shift to apply

Definition at line 432 of file ogl_draw.c.

◆ at_unshift()

void at_unshift ( atom * at,
float * shift )
extern

correct atomic coordinates modified to display image in cell replica

Parameters
atthe atom
shiftthe shift to correct

Definition at line 447 of file ogl_draw.c.

◆ center_this_molecule()

void center_this_molecule ( glwin * view)

center atomic coordinates around (0,0,0) and refresh shaders

Parameters
viewthe target glwin

Definition at line 1522 of file glview.c.

◆ check_label_numbers()

int check_label_numbers ( project * this_proj,
int types )
extern

check how many atom label(s) are visible

Parameters
this_projthe target project
types0 = atoms, 1 = clones, 2 = all

Definition at line 1040 of file popup.c.

◆ cleaning_shaders()

void cleaning_shaders ( glwin * view,
int shader )
extern

re-initialize an OpenGL shader

Parameters
viewthe target glwin
shaderthe shader to initialize

Definition at line 695 of file ogl_shading.c.

◆ create_atom()

gboolean create_atom ( GLUquadricObj * quadric,
int aid,
int ac,
int sp,
int sel )
extern

◆ create_axis_matrices()

mat4_t create_axis_matrices ( int type)
extern

create axis OpenGL rendering matrices

Parameters
typeaxis type (standard: 0, atom edition viewer axis: 1)

Definition at line 101 of file d_axis.c.

◆ create_bond()

gboolean create_bond ( int ac,
int bid,
int ba,
int bb,
int sel,
double length )
extern

◆ create_label_matrices()

mat4_t create_label_matrices ( )
extern

create label projection matrices

Definition at line 56 of file d_label.c.

◆ debug_image()

void debug_image ( image img,
int i )
extern

◆ dihedral_3d()

angle dihedral_3d ( cell_info * cell,
int mdstep,
atom * at,
atom * bt,
atom * ct,
atom * dt )
extern

dihedral between atom a, b, c and d in 3D

Parameters
cellunit cell
mdstepthe MD step
atatom a
btatom b
ctatom c
dtatom d

Definition at line 204 of file ogl_utils.c.

◆ distance_2d()

distance distance_2d ( atom * at,
atom * bt )
extern

distance between atom a and b in 2D

Parameters
atatom a
btatom b

Definition at line 60 of file ogl_utils.c.

◆ distance_3d()

distance distance_3d ( cell_info * cell,
int mdstep,
atom * at,
atom * bt )
extern

distance between atom a and b in 3D

Parameters
cellunit cell
mdstepthe MD step
atatom a
btatom b

Definition at line 81 of file ogl_utils.c.

◆ draw()

void draw ( glwin * view)
extern

main drawing subroutine for the OpenGL window

Parameters
viewthe target glwin

Definition at line 461 of file ogl_draw.c.

◆ draw_atom()

void draw_atom ( atom at,
double al )
extern

◆ draw_atom_to_pick()

void draw_atom_to_pick ( atom at)
extern

◆ draw_box()

void draw_box ( )
extern

◆ draw_cylinder_bond()

void draw_cylinder_bond ( atom a,
atom b,
int bid,
int ci,
int bi )
extern

◆ draw_cylinder_bond_to_pick()

void draw_cylinder_bond_to_pick ( atom a,
atom b,
int bid )
extern

◆ draw_rings_gl()

void draw_rings_gl ( int se,
int ge,
int ta,
int id )
extern

◆ draw_vertices()

void draw_vertices ( int id)
extern

Draw OpenGL shader program.

Parameters
idthe ID of the program to render

Definition at line 1028 of file ogl_shading.c.

◆ draw_wireframe_bond()

void draw_wireframe_bond ( atom a,
atom b,
int ci,
int bi )
extern

◆ duplicate_atom()

atom * duplicate_atom ( atom * at)
extern

copy (partially) an atom data structure

Parameters
atthe atom to copy

Definition at line 396 of file ogl_draw.c.

◆ free_this_search_data()

atom_search * free_this_search_data ( atom_search * this_search)
extern

free atom search data structure

Parameters
this_searchthe data to free

Definition at line 285 of file popup.c.

◆ get_insertion_coordinates()

vec3_t get_insertion_coordinates ( glwin * view)
extern

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

Parameters
viewthe target glwin

Definition at line 794 of file glwindow.c.

◆ init_camera()

void init_camera ( project * this_proj,
gboolean get_depth )

◆ init_color()

ColRGBA init_color ( int id,
int numid )

initialize color based id number over total number of elements

Parameters
idthe id number
numidthe total number of elements

Definition at line 81 of file initcoord.c.

◆ init_default_shaders()

void init_default_shaders ( glwin * view)
extern

re-initialize the default OpenGL shaders

Parameters
viewthe target glwin

Definition at line 729 of file ogl_shading.c.

◆ init_opengl()

void init_opengl ( )

initialize OpenGL rendering parameters

Definition at line 1390 of file glview.c.

◆ init_shader_program()

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 )
extern

create an OpenGL shader program

Parameters
objectshader id (in enum shaders)
object_idshader type in: GLSL_SPHERES, GLSL_POINTS, GLSL_LINES, GLSL_CYLINDERS, GLSL_CAPS, GLSL_POLYEDRA, GLSL_STRING
vertexgeneral shader: in the shaders defined in 'ogl_shaders.c'
geometrygeometry shader, if any: in the shaders defined in 'ogl_shaders.c'
fragmentcolor shader, if any: in the shaders defined in 'ogl_shaders.c'
type_of_verticestype of vertices in: GL_POINTS, GL_LINES, GL_TRIANGLE GL_TRIANGLE_FAN, GL_TRIANGLE_STRIP
narraynumber of vertices to allocate
nunifnumber of uniform location(s) to allocate
lightninguse lightning (1/0)
objthe object 3D to bind to the shader

Definition at line 533 of file ogl_shading.c.

◆ init_shaders()

void init_shaders ( glwin * view)
extern

initialize all the OpenGL shaders

Parameters
viewthe target glwin

Definition at line 757 of file ogl_shading.c.

◆ is_coord_in_menu()

gboolean is_coord_in_menu ( int id,
project * this_proj )
extern

is this coordination in a menu ?

Parameters
idthe coordination type
this_projthe target project

Definition at line 74 of file m_coord.c.

◆ on_expose()

G_MODULE_EXPORT gboolean on_expose ( GtkWidget * widg,
cairo_t * cr,
gpointer data )

OpenGL rendering widget expose event callback GTK3.

Parameters
widgthe GtkWidget sending the signal
crthe cairo drawing context to use for the draw
datathe associated data pointer

Definition at line 1794 of file glview.c.

◆ on_glwin_button_pressed()

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

Parameters
gesturethe GtkGesture sending the signal
n_pressnumber of times it was pressed
xx position
yy position
datathe associated data pointer

Definition at line 975 of file glview.c.

◆ on_glwin_button_released()

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

Parameters
gesturethe GtkGesture sending the signal
n_pressnumber of times it was pressed
xx position
yy position
datathe associated data pointer

Definition at line 991 of file glview.c.

◆ on_glwin_pointer_motion()

G_MODULE_EXPORT void on_glwin_pointer_motion ( GtkEventControllerMotion * motc,
gdouble x,
gdouble y,
gpointer data )

handle mouse motion event in the OpenGL window GTK4

Parameters
motcThe GtkEvenController sending the signal
xx position
yy position
datathe associated data pointer

Definition at line 727 of file glview.c.

◆ on_glwin_pointer_scoll()

G_MODULE_EXPORT gboolean on_glwin_pointer_scoll ( GtkEventControllerScroll * event,
gdouble dx,
gdouble dy,
gpointer data )

handle mouse scroll event on the OpenGL window

Parameters
eventthe GtkEventControllerScroll sending the signal
dxx position
dyy position
datathe associated data pointer

Definition at line 1055 of file glview.c.

◆ on_lib_button_pressed()

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)

Parameters
gesturethe GtkGesture sending the signal
n_pressnumber of times it was pressed
xx position
yy position
datathe associated data pointer

Definition at line 852 of file glview.c.

◆ on_lib_button_released()

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)

Parameters
gesturethe GtkGesture sending the signal
n_pressnumber of times it was pressed
xx position
yy position
datathe associated data pointer

Definition at line 868 of file glview.c.

◆ on_realize()

G_MODULE_EXPORT void on_realize ( GtkWidget * widg,
gpointer data )

realize event for the OpenGL widget

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 1737 of file glview.c.

◆ popup_main_menu()

void popup_main_menu ( glwin * view,
double ptx,
double pty )
extern

create the OpenGL window popup menu

Parameters
viewthe target glwin
ptxx position
ptyy position

Definition at line 4131 of file popup.c.

◆ popup_selection()

void popup_selection ( glwin * view,
double ptx,
double pty,
int spe,
int mmod,
int ati,
int bti,
int aoc )
extern

create the contextual popup menu, right click on atom or bond

Parameters
viewthe target glwin
ptxx position
ptyy position
spethe picked chemical
mmodmouse mode: 0 = analysis, 1 = edition
ati1st atom
bti2nd atom, if any
aocatom (0) or clone (1)

Definition at line 3666 of file popup.c.

◆ prepare_axis()

void prepare_axis ( )
extern

◆ prepare_cuboid()

void prepare_cuboid ( vec3_t position,
int id )
extern

OpenGL 3D light object rendering.

Parameters
positionlight position
idshader number

Definition at line 433 of file d_box.c.

◆ prepare_string()

void prepare_string ( char * text,
int id,
ColRGBA col,
vec3_t pos,
float lshift[3],
atom * at,
atom * bt,
atom * ct )
extern

prepare a screen string to be rendered

Parameters
textthe text to render
idthe label id
colthe color
posthe position
lshiftlabel position shift on x, y and z, if any
atthe 1st atom, if any (bond or angle measure string)
btthe 2nd atom, if any (bond or angle measure string)
ctthe 3rd atom, if any (angle measure string)

Definition at line 691 of file ogl_text.c.

◆ process_selected_atom()

void process_selected_atom ( project * this_proj,
glwin * view,
int id,
int ac,
int se,
int pi )
extern

process selected atom

Parameters
this_projthe target project
viewthe target glwin
idthe atom id
acatom or clone (0/1)
seset to 0 to ensure to remove a selected atom from the list and not to add label
piselection mode (0 = normal mode, 1 = edition mode)

Definition at line 514 of file selection.c.

◆ re_create_all_md_shaders()

void re_create_all_md_shaders ( glwin * view)
extern

re-initialize all MD dependent OpenGL shaders

Parameters
viewthe target glwin

Definition at line 651 of file ogl_shading.c.

◆ re_create_md_shaders()

void re_create_md_shaders ( int nshaders,
int shaders[nshaders],
project * this_proj )
extern

re-initialize some MD dependent OpenGL shaders

Parameters
nshadersthe number of shader(s) to initialize
shadersthe list of shaders
this_projthe target project

Definition at line 673 of file ogl_shading.c.

◆ render_all_strings()

void render_all_strings ( int glsl,
int id )
extern

render all string to be rendered for a label list

Parameters
glslshader id
idlabel id

Definition at line 549 of file ogl_text.c.

◆ reshape()

void reshape ( glwin * view,
int width,
int height,
gboolean use_ratio )

reshape (resize) the OpenGL window

Parameters
viewthe target glwin
widthnew with
heightnew height
use_ratiouse widget rendering ratio

Definition at line 516 of file glview.c.

◆ save_all_selections()

void save_all_selections ( glwin * view,
int pi )
extern

save all selection data

Parameters
viewthe target glwin
piselection mode (0 = normal mode, 1 = edition mode)

Definition at line 372 of file selection.c.

◆ set_default_color()

ColRGBA set_default_color ( int z)

pick the default color for an atom

Parameters
zatomic number

Definition at line 187 of file glview.c.

◆ setup_bonds()

void setup_bonds ( glwin * view)

◆ show_hide_clones()

G_MODULE_EXPORT void show_hide_clones ( GSimpleAction * action,
GVariant * parameter,
gpointer data )
extern

show/hide clones menu item callback

Parameters
actionthe GAction sending the signal
parameterGVariant parameter of the GAction, if any
datathe associated data pointer

Definition at line 139 of file m_clones.c.

◆ sort()

void sort ( int dim,
int * tab )
extern

sort, nim to max, a table by integer value

Parameters
dimthe number of value
tabthe table to sort

Definition at line 380 of file glview.c.

◆ to_center_this_molecule()

G_MODULE_EXPORT void to_center_this_molecule ( GtkWidget * widg,
gpointer data )

center this molecule menu item callback GTK4

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 3974 of file popup.c.

◆ update()

void update ( glwin * view)

update the rendering of the OpenGL window

Parameters
viewthe target glwin

Definition at line 439 of file glview.c.

◆ update_all_menus()

void update_all_menus ( glwin * view,
int nats )
extern

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_all_selections()

void update_all_selections ( glwin * view,
int pi )
extern

update the selection data: bonds, angles and dihedrals

Parameters
viewthe target glwin
piselection mode (0 = normal mode, 1 = edition mode)

Definition at line 387 of file selection.c.

◆ update_selection_list()

void update_selection_list ( atom_selection * at_list,
atom * at,
gboolean add )
extern

update the selection list adding or removing an atom

Parameters
at_listtarget atom selection
atatom
addadd or remove (1/0)

Definition at line 445 of file selection.c.

◆ update_selection_tree()

void update_selection_tree ( glwin * view,
int sid,
int mid )
extern

update measurements tree view

Parameters
viewthe target glwin
sidthe type of selection (0 = analysis mode, 1 = edition mode)
midthe type of measurement (0 = bonds, 1 = angles, 2 = dihedrals)

Definition at line 381 of file w_measures.c.

◆ zoom()

void zoom ( glwin * view,
int delta )

zoom in or zoom out in the OpenGL window

Parameters
viewthe target glwin
deltathe zoom modification

Definition at line 1006 of file glview.c.

Variable Documentation

◆ acolorm

int acolorm
extern

Definition at line 68 of file ogl_draw.c.

◆ box_gl

box_info* box_gl
extern

Definition at line 64 of file ogl_draw.c.

◆ cell_gl

cell_info* cell_gl
extern

Definition at line 65 of file ogl_draw.c.

◆ coord_gl

coord_info* coord_gl
extern

Definition at line 63 of file ogl_draw.c.

◆ field_object

int field_object
extern

Definition at line 979 of file dlp_field.c.

◆ gColorID

int gColorID[3]
extern

Definition at line 60 of file d_atoms.c.

◆ initlights

GLfloat initlights[4][4]
extern

◆ nba

int nba

Definition at line 333 of file glview.h.

◆ nbl

int nbl

Definition at line 333 of file glview.h.

◆ nbs

int nbs
extern

Definition at line 176 of file d_atoms.c.

◆ ogl_texture

GLenum ogl_texture
extern

Definition at line 114 of file glview.c.

◆ pcolorm

int pcolorm
extern

Definition at line 69 of file ogl_draw.c.

◆ pick

gboolean pick
extern

◆ plot

image* plot
extern

Definition at line 66 of file ogl_draw.c.

◆ proj_at

int proj_at
extern

Definition at line 62 of file ogl_draw.c.

◆ proj_gl

project* proj_gl
extern

Definition at line 60 of file ogl_draw.c.

◆ proj_sp

int proj_sp
extern

Definition at line 61 of file ogl_draw.c.

◆ qual

int qual
extern

Definition at line 67 of file ogl_draw.c.

◆ step

int step
extern

Definition at line 70 of file ogl_draw.c.

◆ to_pop

gl_pop_info to_pop
extern

Definition at line 874 of file glview.c.

◆ wingl

glwin* wingl
extern

Definition at line 59 of file ogl_draw.c.