atomes 1.1.14
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
atom_edit.h
Go to the documentation of this file.
1/* This file is part of the 'atomes' software
2
3'atomes' is free software: you can redistribute it and/or modify it under the terms
4of the GNU Affero General Public License as published by the Free Software Foundation,
5either version 3 of the License, or (at your option) any later version.
6
7'atomes' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
8without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9See the GNU General Public License for more details.
10
11You should have received a copy of the GNU Affero General Public License along with 'atomes'.
12If not, see <https://www.gnu.org/licenses/>
13
14Copyright (C) 2022-2024 by CNRS and University of Strasbourg */
15
22/*
23* This header file: 'atom_edit.h'
24*
25* Contains:
26
27 - Function declarations for the mode edition window
28
29*/
30
31#include "global.h"
32#include "bind.h"
33#include "callbacks.h"
34#include "interface.h"
35#include "initcoord.h"
36#include "glview.h"
37#include "glwindow.h"
38#include "project.h"
39#include "workspace.h"
40
41#ifndef ATOM_EDIT_H_
42#define ATOM_EDIT_H_
43
44#define IDCOL 0
45#define TOLAB 3
46#define TOPIC 4
47
48extern GtkWidget * selection_tab (atom_search * asearch, int nats);
49extern G_MODULE_EXPORT void set_show_axis_toggle (GtkToggleButton * but, gpointer data);
50extern void save_rotation_quaternion (glwin * view);
51extern void center_molecule (project * this_proj);
52extern vec3_t get_arc_ball_vector (glwin * view, int x, int y);
53extern void update_search_tree (atom_search * asearch);
54extern int selected_aspec;
55extern int is_selected;
56extern chemical_data * alloc_chem_data (int spec);
57extern void image_init_spec_data (image * img, project * this_proj, int nsp);
58extern void free_glwin_spec_data (project * this_proj, int spec);
59extern void glwin_init_spec_data (project * this_proj, int nspec);
60extern void prepare_opengl_menu_bar (glwin * view);
61extern gboolean test_vol (double box[2][3], double vect[3][3]);
62extern GtkTreeModel * replace_combo_tree (gboolean insert, int proj);
63extern int get_selected_object_id (gboolean visible, int p, gchar * str, atom_search * asearch);
64extern int get_atom_id_from_periodic_table (atom_search * asearch);
65extern G_MODULE_EXPORT void set_mode (GtkWidget * widg, gpointer data);
66extern insertion_menu mol[];
68extern GtkWidget * coord_menu (glwin * view);
69extern GtkWidget * advanced_coord_properties (glwin * view, int page);
70extern GtkWidget * create_cell_edition_window (project * this_proj, gpointer data);
71extern G_MODULE_EXPORT void window_spinner (GtkWidget * widg, gpointer data);
72extern gchar * mot[2][2];
73
74extern gboolean in_bond (int at, int bd[2]);
75extern int being_copied;
77extern float limit[2];
78extern gchar * action_name[5];
79extern gchar * action_atoms[3];
80extern void check_all_trees (project * this_proj);
81extern atomic_object * get_atomic_object_by_origin (atomic_object * first, int oid, int aid);
82extern void adjust_object_to_move (project * this_proj, atom_search * asearch, int mv, int id);
83extern void motion_to_zero (atom_search * asearch);
84extern int get_asearch_num_objects (atom_search * asearch);
85extern int get_asearch_object (atom_search * asearch);
86extern int get_asearch_filter (atom_search * asearch);
87extern int get_todo_size (atom_search * asearch);
88extern void allocate_todo (atom_search * asearch, int tsize);
89extern void clean_todo (atom_search * asearch);
90extern void clean_picked_and_labelled (atom_search * asearch, gboolean clean_msd);
91extern void adjust_search_param (atom_search * asearch, project * this_proj, int a, int s, int c, gboolean status);
92extern void re_populate_tree_search (atom_search * asearch);
93extern G_MODULE_EXPORT void set_search_mode (GtkComboBox * box, gpointer data);
94extern G_MODULE_EXPORT void set_object_changed (GtkComboBox * box, gpointer data);
95extern G_MODULE_EXPORT void set_filter_changed (GtkComboBox * box, gpointer data);
96extern G_MODULE_EXPORT void set_spec_changed (GtkComboBox * box, gpointer data);
97
98extern void add_bonds_to_list (int ** new_bond_list, int nat, int nbd, atomic_object * object);
99extern void add_bonds_to_project (project * this_proj, int removed, int nbd, int ** new_bond_list);
100extern gboolean * remove_bonds_from_project (project * this_proj, atomic_object * this_object, int * old_id, atom * new_list, gboolean remove, gboolean passivate);
101#ifdef GTK4
102extern G_MODULE_EXPORT void set_reset_transformation (GtkCheckButton * but, gpointer data);
103#else
104extern G_MODULE_EXPORT void set_reset_transformation (GtkToggleButton * but, gpointer data);
105#endif
106extern void to_remove_this_list_of_objects (project * this_proj, atom_search * asearch);
107extern void to_passivate_using_the_objects (project * this_proj, atom_search * asearch);
108
109extern tint ulam_coord (glwin * view);
110extern void correct_pos_and_get_dim (atomic_object * object, gboolean adjust);
112extern atomic_object * create_object_from_species (project * this_proj, int sid, atom_search * remove);
113extern void reconstruct_bonds (project * this_proj, int ifcl, int * bcid);
114extern void reconstruct_coordinates_for_object (project * this_proj, atomic_object * this_object, gboolean upcoord);
116extern atomic_object * create_object_from_atom_coordination (project * this_proj, int coord, int aid, atom_search * remove);
117extern atomic_object * create_object_from_overall_coordination (project * this_proj, int coord, int aid, atom_search * remove);
118extern atomic_object * create_object_from_frag_mol (project * this_proj, int coord, int geo, atom_search * remove);
119extern void create_object_from_library (int p);
120extern int create_object_from_open_project (project * this_proj, int p);
121extern void clean_this_object (int orig, int act, project * this_proj, atom_search * asearch);
122extern void to_insert_in_project (int stat, int orig, project * this_proj, atom_search * asearch, gboolean visible);
123extern int insert_this_project_from_lib (int id, gboolean visible, project * this_proj, atom_search * asearch);
124extern G_MODULE_EXPORT void set_atoms_to_insert (GtkComboBox * box, gpointer data);
125
126extern void clean_other_window_after_edit (project * this_proj);
127extern void clean_coord_window (project * this_proj);
128extern GtkWidget * create_atom_notebook (project * this_proj, GtkWidget * vbox);
129extern double ** save_coordinates (project * this_proj, int status);
130extern void reset_coordinates (project * this_proj, int status);
131extern vec3_t get_bary (project * this_proj, int status);
132extern void init_coordinates (project * this_proj, int status, gboolean win, gboolean init);
133extern void translate (project * this_proj, int status, int axis, vec3_t trans);
134extern void rotate_quat (project * this_proj, vec4_t q, int status, int axis);
135extern void rotate (project * this_proj, int i, int j, int k, float param);
136extern void random_move (project * this_proj, atom_search * asearch);
137extern void update_coordinates (project * this_proj, int status, int axis, int action);
138extern G_MODULE_EXPORT void repeat_move (GtkSpinButton * res, gpointer data);
139
140#ifdef GTK4
141extern G_MODULE_EXPORT void to_set_move (GtkEditable * widg, gpointer data);
142#else
143extern G_MODULE_EXPORT gboolean to_set_move (GtkWidget * widg, GdkEventFocus * event, gpointer data);
144#endif
145extern G_MODULE_EXPORT void set_move (GtkEntry * res, gpointer data);
146extern void range_has_changed (gpointer data, double v);
147extern void update_range_and_entry (project * this_proj, int i, int j, int k);
148extern G_MODULE_EXPORT gboolean scroll_range_move (GtkRange * range, GtkScrollType scroll, gdouble value, gpointer data);
149extern G_MODULE_EXPORT void range_move (GtkRange * range, gpointer data);
150extern void check_motion_interactors (project * this_proj, atom_search * asearch);
151extern GtkWidget * add_motion_interaction (atom_search * asearch, int axd, project * this_proj);
152
153extern void apply_action (project * this_proj, atom_search * asearch);
154extern void clean_all_trees (atom_search * asearch, project * this_proj);
155extern gboolean do_we_have_objects_in_selection (project * this_proj, atom_search * asearch, gboolean editing);
156extern G_MODULE_EXPORT void take_action (GtkButton * but, gpointer data);
157extern GtkWidget * action_tab (int aid, project * this_proj);
158
159extern int find_this_geo_id (int id, coord_info * obj, int * old_z, int old_geo, int old_sp, int new_sp, coord_info * coord, double * new_z);
160extern void check_coord_modification (project * this_proj, int old_id[], atom * new_list,
161 atomic_object * this_object, gboolean movtion, gboolean passivating);
162extern void print_coord_info (project * this_proj, coord_info * coord);
163extern coord_info * duplicate_coord_info (coord_info * old_coord);
164extern void recover_opengl_data (project * this_proj, int nmols, int add, int rem, int * num, int * rec, int *** tmpgeo, gboolean * showfrag);
165
166extern chemical_data * duplicate_chemical_data (int spec, chemical_data * chem);
167extern int find_spec_id (int s, int z, double * list_z);
168extern int search_for_new_spec (atom_edition * edit, atomic_object * object);
169
170extern void prepare_atom_edition (gpointer data, gboolean visible);
171
172#ifdef GTK4
173G_MODULE_EXPORT void action_window (GSimpleAction * action, GVariant * parameter, gpointer data);
174#else
175G_MODULE_EXPORT void action_window (GtkWidget * widg, gpointer data);
176#endif
177G_MODULE_EXPORT void close_build (GtkWidget * widg, gpointer data);
178#endif
atomic_object * create_object_from_selection(project *this_proj)
create object from atom selection
GtkTreeModel * replace_combo_tree(gboolean insert, int proj)
replace combo box in the tree view
Definition w_search.c:2615
vec3_t get_arc_ball_vector(glwin *view, int x, int y)
Definition arcball.c:46
void rotate(project *this_proj, int i, int j, int k, float param)
rotate
Definition atom_move.c:309
atomic_object * lib_object
chemical_data * duplicate_chemical_data(int spec, chemical_data *chem)
duplicate chemical data information
atomic_object * create_object_from_frag_mol(project *this_proj, int coord, int geo, atom_search *remove)
create object from a fragment or a molecule
G_MODULE_EXPORT gboolean scroll_range_move(GtkRange *range, GtkScrollType scroll, gdouble value, gpointer data)
motion callback - scroll
Definition atom_move.c:1076
void print_coord_info(project *this_proj, coord_info *coord)
print coordination info
Definition atom_coord.c:87
GtkWidget * coord_menu(glwin *view)
double ** save_coordinates(project *this_proj, int status)
save atomic coordinates
Definition atom_move.c:91
void motion_to_zero(atom_search *asearch)
reset motion to 0.0
Definition w_search.c:493
int get_asearch_object(atom_search *asearch)
get the number of object(s) in this atom search
Definition w_search.c:149
void clean_coord_window(project *this_proj)
update the environment configuration window after edtion
Definition atom_edit.c:87
atom_search * remove_search
Definition popup.c:174
void adjust_object_to_move(project *this_proj, atom_search *asearch, int mv, int id)
adjust atom search parameters for motion cases
Definition w_search.c:523
atomic_object * create_object_from_species(project *this_proj, int sid, atom_search *remove)
create object from all atom(s) of the same chemical species
void save_rotation_quaternion(glwin *view)
save the rotation quaternion of the last image
Definition glview.c:537
gboolean test_vol(double box[2][3], double vect[3][3])
is the cell properly described to use PBC ?
Definition edit_menu.c:498
G_MODULE_EXPORT void set_move(GtkEntry *res, gpointer data)
motion callback - entry
Definition atom_move.c:1046
void add_bonds_to_list(int **new_bond_list, int nat, int nbd, atomic_object *object)
add object bond(s) list to overall bond(s) list
Definition atom_insert.c:81
gchar * action_name[5]
Definition atom_edit.c:60
GtkWidget * selection_tab(atom_search *asearch, int nats)
create the search widget
Definition w_search.c:4130
void correct_pos_and_get_dim(atomic_object *object, gboolean adjust)
get the barycenter of the atomic coordinates of an object
int find_this_geo_id(int id, coord_info *obj, int *old_z, int old_geo, int old_sp, int new_sp, coord_info *coord, double *new_z)
if required create a new geometry, stored in coord, for coordination type 'gid' and chemical species ...
Definition atom_geo.c:209
void prepare_atom_edition(gpointer data, gboolean visible)
prepare atom edition
Definition atom_edit.c:459
G_MODULE_EXPORT void set_reset_transformation(GtkToggleButton *but, gpointer data)
reset model transformation toggle callback GTK3
Definition atom_edit.c:277
int find_spec_id(int s, int z, double *list_z)
find species id based on Z
void apply_action(project *this_proj, atom_search *asearch)
apply edition action
G_MODULE_EXPORT void repeat_move(GtkSpinButton *res, gpointer data)
repeat motion callback
Definition atom_move.c:963
int get_todo_size(atom_search *asearch)
get the size of the atom search selection list
Definition w_search.c:3681
GtkWidget * action_tab(int aid, project *this_proj)
create model edtion action tab
int search_for_new_spec(atom_edition *edit, atomic_object *object)
search for new chemical species
void add_bonds_to_project(project *this_proj, int removed, int nbd, int **new_bond_list)
add bond list to project bond list
Definition atom_insert.c:53
void clean_other_window_after_edit(project *this_proj)
update other windows after model edition if required
Definition atom_edit.c:110
void init_coordinates(project *this_proj, int status, gboolean win, gboolean init)
preserve atomic coordinates
Definition atom_move.c:197
gboolean do_we_have_objects_in_selection(project *this_proj, atom_search *asearch, gboolean editing)
check for object(s) in selection to apply action
int create_object_from_open_project(project *this_proj, int p)
create object from atom(s) of a project opened in the workspace
G_MODULE_EXPORT void window_spinner(GtkWidget *widg, gpointer data)
create the spin window callback
Definition w_spiner.c:158
void random_move(project *this_proj, atom_search *asearch)
random move
Definition atom_move.c:657
GtkWidget * create_cell_edition_window(project *this_proj, gpointer data)
create the cell editon window
Definition cell_edit.c:182
chemical_data * alloc_chem_data(int spec)
allocate chemistry data
Definition open_p.c:186
void reset_coordinates(project *this_proj, int status)
reset transformation and restore saved atomic coordinates
Definition atom_move.c:143
void update_search_tree(atom_search *asearch)
update search tree
Definition w_search.c:1294
int is_selected
Definition popup.c:181
G_MODULE_EXPORT void close_build(GtkWidget *widg, gpointer data)
int get_asearch_num_objects(atom_search *asearch)
the number of type of object(s) in this atom search
Definition w_search.c:125
void free_glwin_spec_data(project *this_proj, int spec)
free the memory used by the chemical species related data in a glwin data structure
Definition glview.c:1539
G_MODULE_EXPORT void set_show_axis_toggle(GtkToggleButton *but, gpointer data)
show / hide axis callback GTK3
Definition w_axis.c:193
G_MODULE_EXPORT void set_filter_changed(GtkComboBox *box, gpointer data)
change the search filter
Definition w_search.c:3858
int get_selected_object_id(gboolean visible, int p, gchar *str, atom_search *asearch)
get the id of the object selected (in contextual menu, or in combo box)
Definition w_search.c:2385
atomic_object * create_object_from_overall_coordination(project *this_proj, int coord, int aid, atom_search *remove)
create object from all the atom(s) that have the same exact coordination than the target atom
void glwin_init_spec_data(project *this_proj, int nspec)
initialize the glwin chemical species related pointers
Definition glview.c:1584
void re_populate_tree_search(atom_search *asearch)
re populate search tree after atom action if >= 10 000 atoms
Definition w_search.c:1608
GtkWidget * add_motion_interaction(atom_search *asearch, int axd, project *this_proj)
add motion interaction widgets
Definition atom_move.c:1230
void reconstruct_coordinates_for_object(project *this_proj, atomic_object *this_object, gboolean upcoord)
reconstruct object atomic coordinates using PBC
tint ulam_coord(glwin *view)
shift insertion position for object not to have overlapping objects for multiple/repeated insertions
G_MODULE_EXPORT gboolean to_set_move(GtkWidget *widg, GdkEventFocus *event, gpointer data)
coord_info * duplicate_coord_info(coord_info *old_coord)
duplicate coordination information data structure
Definition atom_coord.c:190
int get_asearch_filter(atom_search *asearch)
get asearch filter
Definition w_search.c:170
void prepare_opengl_menu_bar(glwin *view)
update the OpenGL window menu bar
Definition glwindow.c:457
void to_remove_this_list_of_objects(project *this_proj, atom_search *asearch)
prepaer to remove a list of object(s) from a project, one object after another.
void translate(project *this_proj, int status, int axis, vec3_t trans)
translate
Definition atom_move.c:230
atomic_object * create_object_from_atom_coordination(project *this_proj, int coord, int aid, atom_search *remove)
create object from an atom and its nearest neighbors
void range_has_changed(gpointer data, double v)
motion
Definition atom_move.c:1016
G_MODULE_EXPORT void set_atoms_to_insert(GtkComboBox *box, gpointer data)
change the object to insert
void recover_opengl_data(project *this_proj, int nmols, int add, int rem, int *num, int *rec, int ***tmpgeo, gboolean *showfrag)
recover image pointer data and OpenGL window menu structure
Definition atom_coord.c:549
gchar * action_atoms[3]
Definition atom_edit.c:61
gboolean * remove_bonds_from_project(project *this_proj, atomic_object *this_object, int *old_id, atom *new_list, gboolean remove, gboolean passivate)
remove bond(s) from project
G_MODULE_EXPORT void range_move(GtkRange *range, gpointer data)
motion callback - range
Definition atom_move.c:1061
void clean_all_trees(atom_search *asearch, project *this_proj)
clean all tree models in the 'model edition' window
void create_object_from_library(int p)
create object using the molecular library
G_MODULE_EXPORT void action_window(GtkWidget *widg, gpointer data)
open model edition window callback GTK3
Definition atom_edit.c:535
void rotate_quat(project *this_proj, vec4_t q, int status, int axis)
rotate using quaternion
Definition atom_move.c:269
void clean_this_object(int orig, int act, project *this_proj, atom_search *asearch)
clean object data
GtkWidget * advanced_coord_properties(glwin *view, int page)
create the environments configuration window
Definition w_coord.c:1311
void adjust_search_param(atom_search *asearch, project *this_proj, int a, int s, int c, gboolean status)
adjust parameters for this atom search
Definition w_search.c:1745
void update_coordinates(project *this_proj, int status, int axis, int action)
update atomic coordinates on motion
Definition atom_move.c:939
void clean_picked_and_labelled(atom_search *asearch, gboolean clean_msd)
initialize atom search data buffers
Definition w_search.c:3791
atomic_object * duplicate_atomic_object(atomic_object *old_obj)
duplicate an insert object
gchar * mot[2][2]
Definition popup.c:3294
void check_all_trees(project *this_proj)
check all search trees
Definition w_search.c:450
vec3_t get_bary(project *this_proj, int status)
get barycenter of atomic coordinates
Definition atom_move.c:170
int get_atom_id_from_periodic_table(atom_search *asearch)
get atom Z from selection in the periodic table
Definition w_periodic.c:672
void update_range_and_entry(project *this_proj, int i, int j, int k)
update motion range
Definition atom_move.c:979
int insert_this_project_from_lib(int id, gboolean visible, project *this_proj, atom_search *asearch)
insert object from the library
Definition w_library.c:1156
void to_insert_in_project(int stat, int orig, project *this_proj, atom_search *asearch, gboolean visible)
to insert object in project
gboolean in_bond(int at, int bd[2])
is atom at in bond bd
Definition dlp_init.c:892
G_MODULE_EXPORT void set_mode(GtkWidget *widg, gpointer data)
set mouse mode callback
Definition m_tools.c:172
void check_coord_modification(project *this_proj, int old_id[], atom *new_list, atomic_object *this_object, gboolean movtion, gboolean passivating)
void allocate_todo(atom_search *asearch, int tsize)
allocate the selection list data buffer
Definition w_search.c:3717
G_MODULE_EXPORT void take_action(GtkButton *but, gpointer data)
take edition action
int selected_aspec
Definition popup.c:179
G_MODULE_EXPORT void set_object_changed(GtkComboBox *box, gpointer data)
change the search object
Definition w_search.c:3884
int being_copied
void clean_todo(atom_search *asearch)
clean atom search selection list
Definition w_search.c:3730
void center_molecule(project *this_proj)
center atomic coordinates around (0,0,0)
Definition glview.c:1437
float limit[2]
Definition atom_edit.c:59
G_MODULE_EXPORT void set_search_mode(GtkComboBox *box, gpointer data)
change search mode
Definition w_search.c:3983
atomic_object * get_atomic_object_by_origin(atomic_object *first, int oid, int aid)
get insert object from a list by id
Definition w_search.c:474
void to_passivate_using_the_objects(project *this_proj, atom_search *asearch)
prepare passivation (delete of an object, then insert of another one at the same location)
void check_motion_interactors(project *this_proj, atom_search *asearch)
add motion check button
Definition atom_move.c:1160
insertion_menu mol[]
Definition w_library.c:193
void image_init_spec_data(image *img, project *this_proj, int nsp)
initialize the chemical species related pointers in an image data structure
Definition glview.c:1187
void reconstruct_bonds(project *this_proj, int ifcl, int *bcid)
reconstruct the project bond(s)/clone(s) lists after reconstruction using PBC
G_MODULE_EXPORT void set_spec_changed(GtkComboBox *box, gpointer data)
change the search chemical species
Definition w_search.c:3829
GtkWidget * create_atom_notebook(project *this_proj, GtkWidget *vbox)
create the model edition notebook
Definition atom_edit.c:365
Binding to the Fortran90 subroutines.
Callback declarations for main window.
gchar * axis[3]
Definition w_axis.c:65
gchar * param[2]
Global variable declarations Global convenience function declarations Global data structure defin...
project * proj
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
action
Definition glview.h:189
Function declarations for the creation of the OpenGL window.
Function declarations to handle the atomic coordination data.
Messaging function declarations.
double z
Definition ogl_draw.c:57
double y
Definition ogl_draw.c:57
double x
Definition ogl_draw.c:57
Function declarations for reading atomes project file Function declarations for saving atomes proje...
Definition global.h:839
Definition glwin.h:875
Definition glwin.h:277
Definition global.h:98
int c
Definition tab-1.c:95
int a
Definition tab-1.c:95
int status
Definition w_advance.c:160
GtkWidget * res[2]
Definition w_encode.c:212
GtkWidget * img
Definition workspace.c:70
GtkWidget * vbox
Definition workspace.c:72
Function declarations for workspace managment.