The outage for Sunday 24th November has been cancelled.
Bioplib
Protein Structure C Library
 All Data Structures Files Functions Variables Typedefs Macros Pages
OriginPDB.c
Go to the documentation of this file.
1 /************************************************************************/
2 /**
3 
4  \file OriginPDB.c
5 
6  \version V1.2
7  \date 07.07.14
8  \brief Move a PDB linked list to the origin
9 
10  \copyright (c) UCL / Dr. Andrew C. R. Martin 1993-4
11  \author Dr. Andrew C. R. Martin
12  \par
13  Institute of Structural & Molecular Biology,
14  University College London,
15  Gower Street,
16  London.
17  WC1E 6BT.
18  \par
19  andrew@bioinf.org.uk
20  andrew.martin@ucl.ac.uk
21 
22 **************************************************************************
23 
24  This code is NOT IN THE PUBLIC DOMAIN, but it may be copied
25  according to the conditions laid out in the accompanying file
26  COPYING.DOC.
27 
28  The code may be modified as required, but any modifications must be
29  documented so that the person responsible can be identified.
30 
31  The code may not be sold commercially or included as part of a
32  commercial product except as described in the file COPYING.DOC.
33 
34 **************************************************************************
35 
36  Description:
37  ============
38 
39 
40 **************************************************************************
41 
42  Usage:
43  ======
44 
45 **************************************************************************
46 
47  Revision History:
48  =================
49 - V1.0 01.10.92 Original
50 - V1.1 22.02.94 Changed NULL check to any coordinate not 9999.0
51 - V1.2 07.07.14 Use bl prefix for functions By: CTP
52 
53 *************************************************************************/
54 /* Doxygen
55  -------
56  #GROUP Handling PDB Data
57  #SUBGROUP Moving the structure
58  #FUNCTION blOriginPDB()
59  Moves a PDB linked list to the origin, ignoring NULL coordinates.
60 */
61 /************************************************************************/
62 /* Includes
63 */
64 #include <math.h>
65 
66 #include "MathType.h"
67 #include "pdb.h"
68 #include "macros.h"
69 
70 /************************************************************************/
71 /* Defines
72 */
73 
74 /************************************************************************/
75 /* Prototypes
76 */
77 
78 /************************************************************************/
79 /* Variables global to this file only
80 */
81 
82 /************************************************************************/
83 /*>void blOriginPDB(PDB *pdb)
84  --------------------------
85 *//**
86 
87  \param[in,out] *pdb PDB linked list to move
88 
89  Moves a PDB linked list to the origin, ignoring NULL coordinates.
90 
91 - 01.10.92 Original
92 - 22.02.94 Changed NULL check to any coordinate not 9999.0
93 - 11.03.94 Changed NULL check to >9998.0 Added cast to REAL
94 - 07.07.14 Use bl prefix for functions By: CTP
95 */
96 void blOriginPDB(PDB *pdb)
97 {
98  PDB *p;
99  VEC3F cg;
100 
101  blGetCofGPDB(pdb,&cg);
102 
103  for(p=pdb; p!=NULL; NEXT(p))
104  {
105  if(p->x < (REAL)9999.0 || p->y < (REAL)9999.0 || p->z < (REAL)9999.0)
106  {
107  p->x -= cg.x;
108  p->y -= cg.y;
109  p->z -= cg.z;
110  }
111  }
112 }
113 
Include file for PDB routines.
REAL x
Definition: MathType.h:70
#define NULL
Definition: array2.c:99
Definition: pdb.h:298
#define NEXT(x)
Definition: macros.h:249
Useful macros.
Definition: MathType.h:69
double REAL
Definition: MathType.h:67
REAL z
Definition: pdb.h:300
void blGetCofGPDB(PDB *pdb, VEC3F *cg)
Definition: GetCGPDB.c:98
void blOriginPDB(PDB *pdb)
Definition: OriginPDB.c:96
Type definitions for maths.
REAL z
Definition: MathType.h:70
REAL y
Definition: MathType.h:70
REAL x
Definition: pdb.h:300
REAL y
Definition: pdb.h:300