1
/* Copyright (C) 2000 Damir Zucic */
3
/*=============================================================================
8
Execute hide command: hide the selected atoms, i.e. set hiddenF to
9
one for selected atoms. Only the caught complexes are treated.
10
For atoms which are not selected visibility status is not changed.
13
(1) Pointer to MolComplexS structure, with macromol. complexes.
14
(2) The number of macromolecular complexes.
15
(3) Pointer to RuntimeS structure, with some runtime data.
16
(4) Pointer to ConfigS structure, with configuration data.
17
(5) Pointer to GUIS structure, with GUI data.
18
(6) Pointer to NearestAtomS structure.
19
(7) The number of pixels in the main window free area.
20
(8) Pointer to refreshI.
23
(1) The hiddenF set for each atom in each caught complex.
29
========includes:============================================================*/
34
#include <X11/Xutil.h>
36
#include <X11/Xatom.h>
42
/*======function prototypes:=================================================*/
44
int HideBackbone_ (MolComplexS *, int);
45
size_t MainRefresh_ (MolComplexS *, int,
46
RuntimeS *, ConfigS *, GUIS *,
47
NearestAtomS *, size_t, unsigned int);
48
int ControlRefresh_ (MolComplexS *, ConfigS *, GUIS *);
50
/*======execute hide command:================================================*/
52
int Hide_ (MolComplexS *mol_complexSP, int mol_complexesN,
54
ConfigS *configSP, GUIS *guiSP,
55
NearestAtomS *nearest_atomSP, size_t pixelsN,
56
unsigned int *refreshIP)
59
MolComplexS *curr_mol_complexSP;
63
/* Check every macromolecular complex: */
64
for (mol_complexI = 0; mol_complexI < mol_complexesN; mol_complexI++)
66
/** Pointer to the current macromolecular complex: **/
67
curr_mol_complexSP = mol_complexSP + mol_complexI;
69
/** Check is the current macromolecular complex caught: **/
70
if (curr_mol_complexSP->catchF == 0) continue;
72
/** Number of atoms in a macromolecular complex: **/
73
atomsN = curr_mol_complexSP->atomsN;
74
if (atomsN == 0) continue;
76
/** Scan all atoms in the current complex: **/
77
for (atomI = 0; atomI < atomsN; atomI++)
79
/** Pointer to the current atom: **/
80
curr_atomSP = curr_mol_complexSP->atomSP + atomI;
82
/** Check the selection flag; hide selected atoms: **/
83
if (curr_atomSP->selectedF) curr_atomSP->hiddenF = 1;
87
/* Hide backbone (update hiddenF for each selected CA atom): */
88
HideBackbone_ (mol_complexSP, mol_complexesN);
90
/* Refresh the main window: */
92
MainRefresh_ (mol_complexSP, mol_complexesN, runtimeSP, configSP, guiSP,
93
nearest_atomSP, pixelsN, *refreshIP);
95
/* Refresh the control window: */
96
ControlRefresh_ (mol_complexSP + runtimeSP->default_complexI, configSP, guiSP);
98
/* Return the command code: */
102
/*===========================================================================*/