ccp4srs  Version 1.0.0
ccp4srs_bond.h
Go to the documentation of this file.
1 // $Id: ccp4srs_bond.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_bond <interface>
30 // ~~~~~~~~~
31 // **** Classes : ccp4srs::Bond - atom description class
32 // ~~~~~~~~~
33 //
34 // (C) E. Krissinel 2010-2013
35 //
36 // =================================================================
37 //
38 
39 #ifndef CCP4SRS_BOND_H
40 #define CCP4SRS_BOND_H
41 
42 #include "ccp4srs_atom.h"
43 
44 namespace ccp4srs {
45 
46  DefineClass(Bond);
47 
48  class Bond {
49 
50  public:
51 
52  // bond orders
54 
55  Bond();
56  virtual ~Bond();
57 
58  inline int atom1 () { return atom_1; }
59  inline int atom2 () { return atom_2; }
60  inline int order () { return bond_order; }
61  inline mmdb::realtype length () { return bond_length; }
62  inline mmdb::realtype length_esd() { return bond_length_esd; }
63 
64  static void makeCIFTags ( mmdb::mmcif::PLoop mmCIFLoop );
65  int readFromCIF_ccp4 ( mmdb::mmcif::PLoop mmCIFLoop, int bondNo,
66  Container<Atom> & atoms );
67  int readFromCIF_rcsb ( mmdb::mmcif::PLoop mmCIFLoop, int bondNo,
68  Container<Atom> & atoms );
69  int readFromCIF ( mmdb::mmcif::PStruct mmCIFStruct,
70  Container<Atom> & atoms );
71  void writeToCIF ( mmdb::mmcif::PLoop mmCIFLoop, mmdb::cpstr monID,
72  Container<Atom> & atoms );
73 
74  bool compare ( Container<Atom> & atoms, PBond bond,
75  Container<Atom> & bond_atoms );
76 
77  bool copy ( Container<Atom> & atoms, PBond bond,
78  Container<Atom> & bond_atoms );
79 
80  void write_mem ( PMemIO memIO, int version );
81  bool read_mem ( PMemIO memIO, int version,
82  bool * Ok = NULL );
83 
84  void copy ( PBond bond, mmdb::ivector anmatch=NULL );
85 
86  protected:
87  int atom_1,atom_2;
88  int bond_order;
89  mmdb::realtype bond_length;
90  mmdb::realtype bond_length_esd;
92 
94  };
95 
96 } // namespace ccp4srs
97 
98 #endif // CCP4SRS_BOND_H
bool copy(Container< Atom > &atoms, PBond bond, Container< Atom > &bond_atoms)
Definition: ccp4srs_bond.cpp:251
DefineClass(Angle)
int atom_2
ordinal numbers of bonded atoms [0,1,.
Definition: ccp4srs_bond.h:87
int readFromCIF_ccp4(mmdb::mmcif::PLoop mmCIFLoop, int bondNo, Container< Atom > &atoms)
Definition: ccp4srs_bond.cpp:130
Bond()
Definition: ccp4srs_bond.cpp:47
Definition: ccp4srs_bond.h:48
Definition: ccp4srs_bond.h:53
bool compare(Container< Atom > &atoms, PBond bond, Container< Atom > &bond_atoms)
Definition: ccp4srs_bond.cpp:232
mmdb::realtype bond_length_esd
Definition: ccp4srs_bond.h:91
int readFromCIF_rcsb(mmdb::mmcif::PLoop mmCIFLoop, int bondNo, Container< Atom > &atoms)
Definition: ccp4srs_bond.cpp:159
int bond_order
bond order
Definition: ccp4srs_bond.h:88
int readFromCIF(mmdb::mmcif::PStruct mmCIFStruct, Container< Atom > &atoms)
Definition: ccp4srs_bond.cpp:190
void write_mem(PMemIO memIO, int version)
Definition: ccp4srs_bond.cpp:313
int atom1()
Definition: ccp4srs_bond.h:58
Definition: ccp4srs_bond.h:53
int order()
Definition: ccp4srs_bond.h:60
Definition: ccp4srs_bond.h:53
Definition: ccp4srs_bond.h:53
mmdb::realtype bond_length
Definition: ccp4srs_bond.h:89
virtual ~Bond()
Definition: ccp4srs_bond.cpp:56
Definition: ccp4srs_bond.h:53
void writeToCIF(mmdb::mmcif::PLoop mmCIFLoop, mmdb::cpstr monID, Container< Atom > &atoms)
Definition: ccp4srs_bond.cpp:302
mmdb::realtype length()
Definition: ccp4srs_bond.h:61
Definition: ccp4srs_angle.cpp:42
Definition: ccp4srs_container.h:48
bool read_mem(PMemIO memIO, int version, bool *Ok=NULL)
Definition: ccp4srs_bond.cpp:323
Definition: ccp4srs_bond.h:53
int atom_1
Definition: ccp4srs_bond.h:87
Definition: ccp4srs_bond.h:53
mmdb::realtype length_esd()
Definition: ccp4srs_bond.h:62
static void makeCIFTags(mmdb::mmcif::PLoop mmCIFLoop)
Definition: ccp4srs_bond.cpp:293
Definition: ccp4srs_bond.h:53
int atom2()
Definition: ccp4srs_bond.h:59