atomes 1.1.16
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
atom_remove.c
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
23/*
24* This file: 'atom_remove.c'
25*
26* Contains:
27*
28
29 - The functions to remove bond(s) from a project
30 - The function to prepare the passivation (removal followed by insertion)
31
32*
33* List of functions:
34
35 int test_this_fragment (int natomes, int fcoord, int fid, atom * atom_list, int * old_id, gboolean remove);
36
37 gboolean * remove_bonds_from_project (project * this_proj, atomic_object * this_object, int * old_id, atom * new_list, gboolean remove, gboolean passivate);
38
39 void set_mol_data (int the_atom, int the_mol);
40 void to_remove_this_list_of_objects (project * this_proj, atom_search * asearch);
41 void to_passivate_using_the_objects (project * this_proj, atom_search * asearch);
42
43*/
44
45#include "atom_edit.h"
46
47int tmbs;
50int * tigl;
51int * migl;
52int * togl;
54int * ats_id;
56int ** neighbors;
57
58extern atom_search * allocate_atom_search (int proj, int action, int searchid, int tsize);
59
70void set_mol_data_list (int aid, atom ** mol_list, int the_mol)
71{
72 int ab, ac, ad;
73 molcounter ++;
74 int the_atom = tigl[aid];
75 togl[the_atom] = the_mol;
76 tmbs ++;
77
78 if (molcounter == 10000) goto end;
79 if (tmbs == atoms_in_frag) goto end;
80 int mid = migl[aid];
81 for (ab=0; ab < mol_list[mid] -> numv; ab++)
82 {
83 ac = mol_list[mid] -> vois[ab];
84 ad = tigl[ac];
85 if (! togl[ad] && molcounter < 100000) set_mol_data_list (ac, mol_list, the_mol);
86 if (tmbs == atoms_in_frag) goto end;
87 if (molcounter == 10000) goto end;
88 }
89
90 molcounter --;
91 end:;
92}
93
106int test_this_fragment (int natomes, int fcoord, int fid, atom ** atom_list, int * old_id, gboolean remove)
107{
108 int i, j, k, l, m, n;
109 gboolean modif;
110 tigl = allocint(natomes);
111 migl = allocint(natomes);
112 i = 0;
113 for (j=0; j<natomes; j++)
114 {
115 modif = FALSE;
116 if (! remove)
117 {
118 modif = TRUE;
119 }
120 else if (old_id)
121 {
122 if (atom_list[j])
123 {
124 if (old_id[atom_list[j] -> id] > 0) modif = TRUE;
125 }
126 }
127 if (modif)
128 {
129 if (atom_list[j] -> coord[2] == fid)
130 {
131 tigl[atom_list[j] -> id] = i;
132 migl[atom_list[j] -> id] = j;
133 i ++;
134 }
135 }
136 }
137
138 if (i)
139 {
140 togl = allocint(i);
141 atoms_in_frag = i;
142
143 // Check each atoms (recursive testing)
144 int totmol = 0;
145 tmbs = molcounter = 0;
146 start:;
147 i = 0;
148 for (j=0; j<natomes; j++)
149 {
150 if (atom_list[j])
151 {
152 if (atom_list[j] -> coord[2] == fid)
153 {
154 k = tigl[atom_list[j] -> id];
155 if (! molcounter && ! togl[k])
156 {
157 totmol ++;
158 set_mol_data_list (atom_list[j] -> id, atom_list, totmol);
159 if (tmbs == atoms_in_frag) goto end;
160 if (molcounter == 10000) goto start;
161 molcounter = 0;
162 }
163 else if (molcounter > 0 && togl[k] == totmol)
164 {
165 for (l=0; l<atom_list[j] -> numv; l++)
166 {
167 m = atom_list[j] -> vois[l];
168 n = tigl[m];
169 if (! togl[n])
170 {
171 molcounter = 0;
172 i = 1;
173 set_mol_data_list (m, atom_list, totmol);
174 if (tmbs == atoms_in_frag) goto end;
175 if (molcounter == 10000) goto start;
176 molcounter = 1;
177 }
178 }
179 }
180 }
181 }
182 }
183 if (tmbs < atoms_in_frag)
184 {
185 molcounter = 0;
186 goto start;
187 }
188 if (molcounter) goto start;
189 end:;
190 i = 0;
191 for (j=0; j<natomes; j++)
192 {
193 if (atom_list[j])
194 {
195 k = atom_list[j] -> id;
196 l = tigl[k];
197 if (togl[l] > 1)
198 {
199 atom_list[j] -> coord[2] = fcoord + togl[l] - 2;
200 // g_debug ("togl[l] = %d, j= %d, atom_list[j] -> coord[2]= %d", togl[l], j, atom_list[j] -> coord[2]);
201 }
202 i = max (i, togl[l]);
203 }
204 }
205 g_free (togl);
206 }
207 g_free (tigl);
208 g_free (migl);
209 return i-1;
210}
211
224gboolean * remove_bonds_from_project (project * this_proj, atomic_object * this_object, int * old_id, atom * new_list, gboolean remove, gboolean passivate)
225{
226 int h, i, j, k, l, m;
227 int tmpbond[2];
228 int ** tmpbondid[2];
229 atom * tmp_list;
230 gboolean * frag_to_test;
231 gboolean * frag_to_remove;
232 gboolean * show_frag = NULL;
233 int * per_frag;
234 int * in_frag;
235 int * tmp_vois = NULL;
236 int * id_mod = NULL;
237
238 /* tmp_list = new_list;
239 while (tmp_list)
240 {
241 i = tmp_list -> id;
242 if ((remove && old_id[i] > 0) || ! remove)
243 {
244 g_debug ("Keeping atom: %d", i+1);
245 g_debug (" atom: %d has: %d neighbor(s):", i+1, tmp_list -> numv);
246 for (j=0; j<tmp_list -> numv; j++)
247 {
248 g_debug (" n: %d, atom= %d", j+1, tmp_list -> vois[j]+1);
249 }
250 }
251 tmp_list = tmp_list -> next;
252 }*/
253
254 int tcf = (this_proj) ? this_proj -> coord -> totcoord[2] : this_object -> coord -> totcoord[2];
255 if (this_proj)
256 {
257 if (tcf)
258 {
259 show_frag = duplicate_bool (tcf, this_proj -> modelgl -> anim -> last -> img -> show_coord[2]);
260 }
261 else
262 {
263 show_frag = allocbool (1);
264 show_frag[0] = TRUE;
265 tcf = 1;
266 }
267 }
268
269 int nat = (this_proj) ? this_proj -> natomes : this_object -> atoms;
270 per_frag = allocint (tcf);
271 in_frag = allocint (tcf);
272 id_mod = allocint (nat);
273 tmp_vois = allocint (20);
274 h = -1;
275 tmp_list = new_list;
276 for (i=0; i<nat; i++)
277 {
278 j = (this_proj) ? this_proj -> atoms[0][i].coord[2] : tmp_list -> coord[2];
279 per_frag[j] ++;
280 if (old_id[i] < 0)
281 {
282 in_frag[j] ++;
283 if (! remove && ! passivate)
284 {
285 h ++;
286 id_mod[tmp_list -> id] = h;
287 }
288 }
289 else
290 {
291 h ++;
292 id_mod[tmp_list -> id] = h;
293 }
294
295 if (old_id[i] > 0 || ! remove)
296 {
297 if (tmp_list -> numv > 0)
298 {
299 k = 0;
300 // Save the neighbors list for this atom
301 for (l=0; l<tmp_list -> numv; l++)
302 {
303 m = tmp_list -> vois[l];
304 if ((remove && old_id[m] > 0) || (! remove && old_id[i] > 0 && old_id[m] > 0) || (! remove && old_id[i] < 0 && old_id[m] < 0))
305 {
306 tmp_vois[k] = m;
307 k ++;
308 }
309 }
310 g_free (tmp_list -> vois);
311 tmp_list -> vois = NULL;
312 tmp_list -> numv = k;
313 if (k)
314 {
315 // Correct the neighbor list for this atom
316 tmp_list -> vois = allocint (k);
317 for (l=0; l<k; l++) tmp_list -> vois[l] = tmp_vois[l];
318 }
319 }
320 }
321 if ( old_id[i] > 0 || ! remove || passivate) tmp_list = tmp_list -> next;
322 }
323 g_free (tmp_vois);
324
325 // Taking care of the isolated atom(s)
326 tmp_list = new_list;
327 while (tmp_list)
328 {
329 i = tmp_list -> coord[2];
330 if (! tmp_list -> numv && per_frag[i] > 1 && old_id[tmp_list -> id] > 0)
331 {
332 // If the atom has no neighbors, and if it is not the last one in the fragment
333 show_frag = g_realloc (show_frag, (tcf+1)*sizeof*show_frag);
334 per_frag = g_realloc (per_frag, (tcf+1)*sizeof*per_frag);
335 in_frag = g_realloc (in_frag, (tcf+1)*sizeof*in_frag);
336 show_frag[tcf] = show_frag[i];
337 per_frag[tcf] = 1;
338 per_frag[i] --;
339 tmp_list -> coord[2] = tcf;
340 tcf ++;
341 }
342 tmp_list = tmp_list -> next;
343 }
344
345 frag_to_test = allocbool (tcf);
346 frag_to_remove = allocbool (tcf);
347 for (i=0; i<tcf; i++)
348 {
349 if (in_frag[i] == per_frag[i])
350 {
351 if (remove)
352 {
353 frag_to_remove[i] = TRUE;
354 }
355 else
356 {
357 frag_to_test[i] = TRUE;
358 }
359 }
360 else if (per_frag[i] > 1 && in_frag[i])
361 {
362 frag_to_test[i] = TRUE;
363 }
364 // g_debug ("i= %d, frag_to_test[%d]= %d, frag_to_remove[%d]= %d, in_frag[%d]= %d, per_frag[%d]= %d", i, i, frag_to_test[i], i, frag_to_remove[i], i, in_frag[i], i, per_frag[i]);
365 }
366 g_free (in_frag);
367 g_free (per_frag);
368 atom ** atom_list = g_malloc0 (nat*sizeof*atom_list);
369 tmp_list = new_list;
370 while (tmp_list)
371 {
372 i = tmp_list -> id;
373 if (old_id[i] > 0 || ! remove)
374 {
375 atom_list[i] = duplicate_atom (tmp_list);
376 }
377 tmp_list = tmp_list -> next;
378 }
379 if (remove && this_proj)
380 {
381 i = 0;
382 // Removing fragment(s) if needed
383 int * new_fid = allocint (tcf);
384 for (j=0; j<tcf; j++) new_fid[j] = j;
385 for (j=0; j<tcf-1; j++)
386 {
387 if (frag_to_remove[j])
388 {
389 for (k=j+1; k<tcf; k++) new_fid[k] --;
390 }
391 }
392 for (j=0; j<tcf; j++)
393 {
394 if (frag_to_remove[j])
395 {
396 for (k=j; k<tcf-i-1; k++) show_frag[k] = show_frag[k+1];
397 for (k=j; k<tcf-i-1; k++) frag_to_test[k] = frag_to_test[k+1];
398 i ++;
399 }
400 }
401 for (j=0; j<nat; j++)
402 {
403 if (atom_list[j]) atom_list[j] -> coord[2] = new_fid[atom_list[j] -> coord[2]];
404 }
405 g_free (new_fid);
406 tcf -= i;
407 if (i)
408 {
409 show_frag = g_realloc (show_frag, tcf*sizeof*show_frag);
410 }
411 }
412 i = tcf;
413 for (j=0; j<i; j++)
414 {
415 if (frag_to_test[j])
416 {
417 // g_debug ("testing frag[%d], remove= %d, tcf= %d, nat= %d, j= %d", j, remove, tcf, nat, j);
418 k = test_this_fragment (nat, tcf, j, atom_list, old_id, remove);
419 // g_debug ("After testing: k= %d", k);
420 if (k > 0)
421 {
422 show_frag = g_realloc (show_frag, (tcf+k)*sizeof*show_frag);
423 for (l=tcf; l<tcf+k; l++) show_frag[l] = show_frag[j];
424 tcf += k;
425 }
426 }
427 }
428 g_free (frag_to_test);
429 g_free (frag_to_remove);
430 if (this_proj)
431 {
432 this_proj -> coord -> totcoord[2] = tcf;
433 }
434 else
435 {
436 this_object -> coord -> totcoord[2] = tcf;
437 }
438 tmp_list = new_list;
439 while (tmp_list)
440 {
441 i = tmp_list -> id;
442 if (old_id[i] > 0 || ! remove)
443 {
444 tmp_list -> coord[2] = atom_list[i] -> coord[2];
445 g_free (atom_list[i]);
446 // g_debug ("End:: id= %d, coord[2]= %d", tmp_list -> id, tmp_list -> coord[2]);
447 }
448 tmp_list = tmp_list -> next;
449 }
450 g_free (atom_list);
451
452 if (this_proj)
453 {
454 for (i=0; i<2; i++)
455 {
456 tmpbondid[i] = NULL;
457 tmpbond[i] = 0;
458 }
459 for (i=0; i<2; i++)
460 {
461 if (this_proj -> modelgl -> bonds[0][i])
462 {
463 tmpbondid[i] = allocdint (this_proj -> modelgl -> bonds[0][i], 2);
464 j = 0;
465 for (k=0; k<this_proj -> modelgl -> bonds[0][i]; k++)
466 {
467 l = this_proj -> modelgl -> bondid[0][i][k][0];
468 m = this_proj -> modelgl -> bondid[0][i][k][1];
469 if (old_id[l] > 0 && old_id[m] > 0)
470 {
471 tmpbondid[i][j][0] = l;
472 tmpbondid[i][j][1] = m;
473 j ++;
474 }
475 else if (! remove && (old_id[l] < 0 && old_id[m] < 0))
476 {
477 tmpbondid[i][j][0] = l;
478 tmpbondid[i][j][1] = m;
479 j ++;
480 }
481 }
482 tmpbond[i] = j;
483 // g_debug ("i= %d, tmpbond[%d]= %d", i, i, tmpbond[i]);
484 }
485 }
486 distance clo;
487 for (i=0; i<2; i++)
488 {
489 if (this_proj -> modelgl -> bonds[0][i])
490 {
491 g_free (this_proj -> modelgl -> bondid[0][i]);
492 this_proj -> modelgl -> bondid[0][i] = NULL;
493 if (i)
494 {
495 g_free (this_proj -> modelgl -> clones[0]);
496 this_proj -> modelgl -> clones[0] = NULL;
497 }
498 if (tmpbond[i])
499 {
500 if (i) this_proj -> modelgl -> clones[0] = g_malloc0 (tmpbond[i]*sizeof*this_proj -> modelgl -> clones[0]);
501 this_proj -> modelgl -> bondid[0][i] = allocdint (tmpbond[i], 2);
502 for (k=0; k<tmpbond[i]; k++)
503 {
504 this_proj -> modelgl -> bondid[0][i][k][0] = id_mod[tmpbondid[i][k][0]];
505 this_proj -> modelgl -> bondid[0][i][k][1] = id_mod[tmpbondid[i][k][1]];
506 //g_debug ("bc:: i= %d, j= %d, a= %d, b= %d", i, k, tmpbondid[i][k][0], tmpbondid[i][k][1]);
507 if (i)
508 {
509 l = this_proj -> modelgl -> bondid[0][i][k][0];
510 m = this_proj -> modelgl -> bondid[0][i][k][1];
511 clo = distance_3d (& this_proj -> cell, 0, & this_proj -> atoms[0][l], & this_proj -> atoms[0][m]);
512 this_proj -> modelgl -> clones[0][k].x = clo.x;
513 this_proj -> modelgl -> clones[0][k].y = clo.y;
514 this_proj -> modelgl -> clones[0][k].z = clo.z;
515 }
516 }
517 }
518 this_proj -> modelgl -> bonds[0][i] = tmpbond[i];
519 this_proj -> modelgl -> allbonds[i] = tmpbond[i];
520 }
521 if (tmpbondid[i])
522 {
523 g_free (tmpbondid[i]);
524 tmpbondid[i] = NULL;
525 }
526 }
527 }
528
529 if (this_proj)
530 {
531 tmp_list = new_list;
532 while (tmp_list)
533 {
534 i = tmp_list -> id;
535 if (old_id[i] > 0 || ! remove)
536 {
537 if (tmp_list -> numv > 0)
538 {
539 for (j=0; j<tmp_list -> numv; j++)
540 {
541 k = tmp_list -> vois[j];
542 tmp_list -> vois[j] = id_mod[k];
543 }
544 }
545 }
546 tmp_list = tmp_list -> next;
547 }
548 }
549 if (id_mod)
550 {
551 g_free (id_mod);
552 id_mod = NULL;
553 }
554 /*tmp_list = new_list;
555 while (tmp_list)
556 {
557 i = tmp_list -> id;
558 if ((remove && old_id[i] > 0) || ! remove)
559 {
560 g_debug ("Correct atom: %d", i+1);
561 g_debug (" atom: %d has: %d neighbor(s):", i+1, tmp_list -> numv);
562 for (j=0; j<tmp_list -> numv; j++)
563 {
564 g_debug (" n: %d, atom= %d", j+1, tmp_list -> vois[j]+1);
565 }
566 }
567 tmp_list = tmp_list -> next;
568 }*/
569 return show_frag;
570}
571
581{
582 int i, j;
583 atomic_object * tmp_object;
584 atomic_object * tmp_replace;
585 if (asearch -> action == REPLACE)
586 {
587 if (asearch -> pointer[0].c == 3)
588 {
589 tmp_replace = this_proj -> modelgl -> atom_win -> to_be_inserted[0];
590 }
591 else
592 {
593 tmp_replace = this_proj -> modelgl -> atom_win -> to_be_inserted[3];
594 }
595 }
596 int filter = get_asearch_filter (asearch);
597 int object = get_asearch_object (asearch);
598 remove_search = allocate_atom_search (this_proj -> id, REMOVE, REMOVE, this_proj -> natomes);
599 for (i=0; i<asearch -> todo_size; i++)
600 {
601 if (asearch -> todo[i])
602 {
603 tmp_object = NULL;
604 if (filter > 0 && filter < 3 && ((object && ! asearch -> passivating) || (object == 2 && asearch -> passivating)))
605 {
606 tmp_object = create_object_from_atom_coordination (this_proj, filter-1, i, remove_search);
607 }
608 else if (filter > 2 && ((object && ! asearch -> passivating) || (object == 2 && asearch -> passivating)))
609 {
610 j = (asearch -> mode && filter == 4) ? filter - 1 : filter;
611 tmp_object = create_object_from_frag_mol (this_proj, j-1, i, remove_search);
612 }
613 else
614 {
615 remove_search -> todo[i] = 1;
616 if (asearch -> action == REPLACE)
617 {
618 tmp_object = g_malloc0(sizeof*tmp_object);
619 tmp_object -> baryc = allocdouble (3);
620 tmp_object -> baryc[0] = this_proj -> atoms[0][i].x;
621 tmp_object -> baryc[1] = this_proj -> atoms[0][i].y;
622 tmp_object -> baryc[2] = this_proj -> atoms[0][i].z;
623 }
624 }
625 if (asearch -> action == REPLACE)
626 {
627 for (j=0; j<3; j++) tmp_replace -> baryc[j] += tmp_object -> baryc[j];
628 tmp_replace = tmp_replace -> next;
629 }
630 if (tmp_object) g_free (tmp_object);
631 }
632 }
633
634 i = 0;
635 for (j=0; j<this_proj -> natomes; j++)
636 {
637 if (remove_search -> todo[j]) i++;
638 }
639 remove_search -> in_selection = i;
640}
641
651{
652 int i, j, k, l, m;
653 atomic_object * object = NULL;
654 atomic_object * tmp_oba, * tmp_obb;
655 int filter = get_asearch_filter (asearch);
656 int num_elem = asearch -> todo_size;
657 int * passivate_todo = duplicate_int (num_elem, asearch -> todo);
658 g_free (asearch -> todo);
659 allocate_todo (asearch, this_proj -> natomes);
660 if (this_proj -> modelgl -> atom_win -> to_be_inserted[3])
661 {
662 tmp_oba = this_proj -> modelgl -> atom_win -> to_be_inserted[3];
663 object = duplicate_atomic_object (tmp_oba);
664 tmp_obb = object;
665 while (tmp_oba -> next)
666 {
667 tmp_oba = tmp_oba -> next;
668 tmp_obb -> next = duplicate_atomic_object (tmp_oba);
669 tmp_obb = tmp_obb -> next;
670 }
671 g_free (this_proj -> modelgl -> atom_win -> to_be_inserted[3]);
672 this_proj -> modelgl -> atom_win -> to_be_inserted[3] = NULL;
673 }
674 gboolean doit;
675 asearch -> in_selection = 0;
676 tmp_oba = object;
677 for (i=0; i<num_elem; i++)
678 {
679 if (passivate_todo[i])
680 {
681 for (j=0; j<this_proj -> natomes; j++)
682 {
683 doit = FALSE;
684 if (this_proj -> atoms[0][j].pick[0])
685 {
686 k = this_proj -> atoms[0][j].sp;
687 switch (filter)
688 {
689 case 0:
690 if (k == i) doit = TRUE;
691 break;
692 case 1:
693 if (this_proj -> atoms[0][j].numv == i) doit = TRUE;
694 break;
695 case 2:
696 l = this_proj -> atoms[0][j].coord[1];
697 for (m=0;m<k;m++) l += this_proj -> coord -> ntg[1][m];
698 if (l == i) doit = TRUE;
699 break;
700 default:
701 if (this_proj -> atoms[0][j].coord[filter-1] == i) doit = TRUE;
702 break;
703 }
704 if (doit)
705 {
706 asearch -> todo[j] = 1;
707 if (this_proj -> modelgl -> atom_win -> to_be_inserted[3] == NULL)
708 {
709 this_proj -> modelgl -> atom_win -> to_be_inserted[3] = duplicate_atomic_object (tmp_oba);
710 tmp_obb = this_proj -> modelgl -> atom_win -> to_be_inserted[3];
711 }
712 else
713 {
714 tmp_obb -> next = duplicate_atomic_object (tmp_oba);
715 tmp_obb -> next -> prev = tmp_obb;
716 tmp_obb = tmp_obb -> next;
717 }
718 tmp_obb -> id = j;
719 asearch -> in_selection ++;
720 }
721 }
722 }
723 if (tmp_oba -> next != NULL) tmp_oba = tmp_oba -> next;
724 }
725 }
726 if (passivate_todo) g_free (passivate_todo);
727 apply_action (this_proj, asearch);
728}
void apply_action(project *this_proj, atom_search *asearch)
apply edition action
Function declarations for the mode edition window.
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
int get_asearch_object(atom_search *asearch)
get the number of object(s) in this atom search
Definition w_search.c:149
atom_search * remove_search
Definition popup.c:175
int get_asearch_filter(atom_search *asearch)
get asearch filter
Definition w_search.c:170
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
atomic_object * duplicate_atomic_object(atomic_object *old_obj)
duplicate an insert object
void allocate_todo(atom_search *asearch, int tsize)
allocate the selection list data buffer
Definition w_search.c:3717
int * togl
Definition atom_remove.c:52
int * ats_id
Definition atom_remove.c:54
int * ats_in_frag
Definition atom_remove.c:53
int atoms_in_frag
Definition atom_remove.c:49
int molcounter
Definition atom_remove.c:48
int * migl
Definition atom_remove.c:51
int * contacts
Definition atom_remove.c:55
int * tigl
Definition atom_remove.c:50
atom_search * allocate_atom_search(int proj, int action, int searchid, int tsize)
allocate atom search data structure
Definition atom_edit.c:392
int tmbs
Definition atom_remove.c:47
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.
int test_this_fragment(int natomes, int fcoord, int fid, atom **atom_list, int *old_id, gboolean remove)
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
void set_mol_data_list(int aid, atom **mol_list, int the_mol)
set molecule id for atom
Definition atom_remove.c:70
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)
int ** neighbors
Definition atom_remove.c:56
GtkFileFilter * filter[NCFORMATS+1]
Definition callbacks.c:1405
int atoms[NUM_STYLES][2]
int bonds[NUM_STYLES][2]
int * duplicate_int(int num, int *old_val)
copy a list of int
Definition global.c:560
gboolean * duplicate_bool(int num, gboolean *old_val)
copy a list of gboolean
Definition global.c:576
distance distance_3d(cell_info *cell, int mdstep, atom *at, atom *bt)
distance between atom a and b in 3D
Definition ogl_utils.c:81
int ** allocdint(int xal, int yal)
allocate an int ** pointer
Definition global.c:330
gboolean * allocbool(int val)
allocate a gboolean * pointer
Definition global.c:254
double * allocdouble(int val)
allocate a double * pointer
Definition global.c:459
int * allocint(int val)
allocate an int * pointer
Definition global.c:314
project * proj
#define max(a, b)
Definition global.h:80
action
Definition glview.h:189
gboolean pick
atom * duplicate_atom(atom *at)
copy (partially) an atom data structure
Definition ogl_draw.c:396
@ REPLACE
Definition glview.h:225
@ REMOVE
Definition glview.h:226
Definition global.h:886
double z
Definition glwin.h:126
double y
Definition glwin.h:125
double x
Definition glwin.h:124
coord_info * coord
Definition global.h:956
int c
Definition tab-1.c:95
GtkWidget * img
Definition workspace.c:70