1
/* Copyright (C) 2000 Damir Zucic */
3
/*=============================================================================
8
For each macromolecular complex, check which atoms are inside slab.
9
If slab mode is not recognized, do nothing. The slab flags will be
10
left intact in this case. Each macromolecular complex may have its
14
(1) Pointer to MolComplexS structure.
15
(2) Number of macromolecular complexes.
18
(1) Slab flag set for each atom in each macromolecular complex. The
19
value zero is assigned to all atoms outside the slab and value
20
one to all atoms inside the slab.
24
The number of atoms inside slab (zero or positive).
27
(1) For each slab mode a separate function is prepared.
29
========includes:============================================================*/
34
#include <X11/Xutil.h>
36
#include <X11/Xatom.h>
41
/*======function prototypes:=================================================*/
43
size_t NoSlab_ (MolComplexS *);
44
size_t PlanarSlab_ (MolComplexS *);
45
size_t SphereSlab_ (MolComplexS *);
46
size_t HalfSphereSlab_ (MolComplexS *);
47
size_t CylinSlab_ (MolComplexS *);
48
size_t HalfCylinSlab_ (MolComplexS *);
50
/*======cut the slab:========================================================*/
52
size_t Slab_ (MolComplexS *mol_complexSP, int mol_complexesN)
55
MolComplexS *curr_mol_complexSP;
57
/* Check every macromolecular complex: */
58
for (mol_complexI = 0; mol_complexI < mol_complexesN; mol_complexI++)
60
/** Pointer to the current macromolecular complex: **/
61
curr_mol_complexSP = mol_complexSP + mol_complexI;
63
/** Do not apply slab if position has not changed: **/
64
if (curr_mol_complexSP->position_changedF == 0) continue;
66
/** Apply the proper slab: **/
67
switch (curr_mol_complexSP->slab_modeI)
69
/*** Slab not used: ***/
71
return NoSlab_ (curr_mol_complexSP);
76
return PlanarSlab_ (curr_mol_complexSP);
81
return SphereSlab_ (curr_mol_complexSP);
84
/*** Semi-spherical: ***/
86
return HalfSphereSlab_ (curr_mol_complexSP);
89
/*** Cylindrical: ***/
91
return CylinSlab_ (curr_mol_complexSP);
94
/*** Semi-cylindrical: ***/
96
return HalfCylinSlab_ (curr_mol_complexSP);
99
/*** Unknown slab mode: ***/
105
/* If this point is reached, slab mode was not recognized: */
109
/*===========================================================================*/