ccp4srs  Version 1.0.0
ccp4srs_chicenter.h
Go to the documentation of this file.
1 // $Id: ccp4srs_chicenter.h $
2 // =================================================================
3 //
4 // CCP4 SRS Library: Storage, Retrieval and Search support for
5 // CCP4 ligand data.
6 //
7 // Copyright (C) Eugene Krissinel 2010-2013.
8 //
9 // This library is free software: you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License version 3, modified in accordance with the provisions
12 // of the license to address the requirements of UK law.
13 //
14 // You should have received a copy of the modified GNU Lesser
15 // General Public License along with this library. If not, copies
16 // may be downloaded from http://www.ccp4.ac.uk/ccp4license.php
17 //
18 // This program is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU Lesser General Public License for more details.
22 //
23 // =================================================================
24 //
25 // 18.09.13 <-- Date of Last Modification.
26 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27 // -----------------------------------------------------------------
28 //
29 // **** Module : ccp4srs_chicenter <interface>
30 // ~~~~~~~~~
31 // **** Classes : ccp4srs::ChiCenter - chiral center class
32 // ~~~~~~~~~
33 //
34 // (C) E. Krissinel 2010-2013
35 //
36 // =================================================================
37 //
38 
39 #ifndef CCP4SRS_CHICENTER_H
40 #define CCP4SRS_CHICENTER_H
41 
42 #include "ccp4srs_atom.h"
43 
44 namespace ccp4srs {
45 
46  DefineClass(ChiCenter);
47 
48  typedef char ChiCenterID[20];
49 
50  class ChiCenter {
51 
52  // Chiral center signs
53  enum {noSign,Positive,Negative,Both};
54 
55  public:
56  ChiCenter();
57  virtual ~ChiCenter();
58 
59  inline mmdb::cpstr id () { return chicenter_id; }
60  inline int center() { return atom_center; }
61  inline int atom1 () { return atom_1; }
62  inline int atom2 () { return atom_2; }
63  inline int atom3 () { return atom_3; }
64  inline int sign () { return volume_sign; }
65 
66  char get_chirality();
67 
68  static void makeCIFTags ( mmdb::mmcif::PLoop mmCIFLoop );
69  int readFromCIF ( mmdb::mmcif::PLoop mmCIFLoop, int chiNo,
70  Container<Atom> & atoms );
71  void writeToCIF ( mmdb::mmcif::PLoop mmCIFLoop, mmdb::cpstr monID,
72  Container<Atom> & atoms );
73 
74  void write_mem ( PMemIO memIO, int version );
75  bool read_mem ( PMemIO memIO, int version, bool * Ok = NULL );
76 
77  void copy ( PChiCenter chicenter, mmdb::ivector anmatch=NULL );
78 
79  protected:
80  ChiCenterID chicenter_id;
82  int atom_1,atom_2;
83  int atom_3;
85 
86  };
87 
88 } // namespace ccp4srs
89 
90 #endif // CCP4SRS_CHICENTER_H
int atom_center
chiral center atom [0,1,...]
Definition: ccp4srs_chicenter.h:81
static void makeCIFTags(mmdb::mmcif::PLoop mmCIFLoop)
Definition: ccp4srs_chicenter.cpp:128
DefineClass(Angle)
int atom2()
Definition: ccp4srs_chicenter.h:62
int atom_2
ordinal numbers of atoms that
Definition: ccp4srs_chicenter.h:82
ChiCenterID chicenter_id
chiral center id
Definition: ccp4srs_chicenter.h:80
int volume_sign
chirality
Definition: ccp4srs_chicenter.h:84
virtual ~ChiCenter()
Definition: ccp4srs_chicenter.cpp:55
int atom1()
Definition: ccp4srs_chicenter.h:61
void write_mem(PMemIO memIO, int version)
Definition: ccp4srs_chicenter.cpp:179
int atom_3
form the center [0,1,...]
Definition: ccp4srs_chicenter.h:83
ChiCenter()
Definition: ccp4srs_chicenter.cpp:46
int sign()
Definition: ccp4srs_chicenter.h:64
int atom_1
Definition: ccp4srs_chicenter.h:82
char get_chirality()
Definition: ccp4srs_chicenter.cpp:63
int atom3()
Definition: ccp4srs_chicenter.h:63
char ChiCenterID[20]
Definition: ccp4srs_chicenter.h:48
void writeToCIF(mmdb::mmcif::PLoop mmCIFLoop, mmdb::cpstr monID, Container< Atom > &atoms)
Definition: ccp4srs_chicenter.cpp:138
Definition: ccp4srs_chicenter.h:50
void copy(PChiCenter chicenter, mmdb::ivector anmatch=NULL)
Definition: ccp4srs_chicenter.cpp:163
Definition: ccp4srs_angle.cpp:42
int center()
Definition: ccp4srs_chicenter.h:60
Definition: ccp4srs_container.h:48
int readFromCIF(mmdb::mmcif::PLoop mmCIFLoop, int chiNo, Container< Atom > &atoms)
Definition: ccp4srs_chicenter.cpp:75
bool read_mem(PMemIO memIO, int version, bool *Ok=NULL)
Definition: ccp4srs_chicenter.cpp:189
mmdb::cpstr id()
Definition: ccp4srs_chicenter.h:59