ccp4srs  Version 1.0.0
ccp4srs_torsion.h
Go to the documentation of this file.
1 // $Id: ccp4srs_torsion.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_torsion <interface>
30 // ~~~~~~~~~
31 // **** Classes : ccp4srs::Torsion - torsion angle restraint class
32 // ~~~~~~~~~
33 //
34 // (C) E. Krissinel 2010-2013
35 //
36 // =================================================================
37 //
38 
39 #ifndef CCP4SRS_TORSION_H
40 #define CCP4SRS_TORSION_H
41 
42 #include "ccp4srs_atom.h"
43 
44 namespace ccp4srs {
45 
46  DefineClass(Torsion);
47 
48  typedef char TorsionID[20];
49 
50  class Torsion {
51 
52  public:
53  Torsion();
54  virtual ~Torsion();
55 
56  inline mmdb::cpstr id () { return torsion_id; }
57  inline int atom1 () { return atom_1; }
58  inline int atom2 () { return atom_2; }
59  inline int atom3 () { return atom_3; }
60  inline int atom4 () { return atom_4; }
61  inline int period() { return torsion_period; }
62  inline mmdb::realtype value () { return torsion; }
63  inline mmdb::realtype esd () { return torsion_esd; }
64 
65  static void makeCIFTags ( mmdb::mmcif::PLoop mmCIFLoop );
66  int readFromCIF ( mmdb::mmcif::PLoop mmCIFLoop, int angleNo,
67  Container<Atom> & atoms );
68  void writeToCIF ( mmdb::mmcif::PLoop mmCIFLoop, mmdb::cpstr monID,
69  Container<Atom> & atoms );
70 
71  void write_mem ( PMemIO memIO, int version );
72  bool read_mem ( PMemIO memIO, int version, bool * Ok = NULL );
73 
74  void copy ( PTorsion trs, mmdb::ivector anmatch=NULL );
75 
76  protected:
77  TorsionID torsion_id;
78  int atom_1,atom_2;
79  int atom_3,atom_4;
81  mmdb::realtype torsion;
82  mmdb::realtype torsion_esd;
83 
85  };
86 
87 } // namespace ccp4srs
88 
89 #endif // CCP4SRS_TORSION_H
mmdb::realtype torsion
torsion angle in degrees
Definition: ccp4srs_torsion.h:81
int atom1()
Definition: ccp4srs_torsion.h:57
DefineClass(Angle)
int readFromCIF(mmdb::mmcif::PLoop mmCIFLoop, int angleNo, Container< Atom > &atoms)
Definition: ccp4srs_torsion.cpp:73
int atom4()
Definition: ccp4srs_torsion.h:60
void write_mem(PMemIO memIO, int version)
Definition: ccp4srs_torsion.cpp:152
int atom_1
Definition: ccp4srs_torsion.h:78
Definition: ccp4srs_torsion.h:50
int torsion_period
that form the angle [0,1,...]
Definition: ccp4srs_torsion.h:80
void writeToCIF(mmdb::mmcif::PLoop mmCIFLoop, mmdb::cpstr monID, Container< Atom > &atoms)
Definition: ccp4srs_torsion.cpp:116
int atom2()
Definition: ccp4srs_torsion.h:58
static void makeCIFTags(mmdb::mmcif::PLoop mmCIFLoop)
Definition: ccp4srs_torsion.cpp:61
bool read_mem(PMemIO memIO, int version, bool *Ok=NULL)
Definition: ccp4srs_torsion.cpp:164
virtual ~Torsion()
Definition: ccp4srs_torsion.cpp:57
void copy(PTorsion trs, mmdb::ivector anmatch=NULL)
Definition: ccp4srs_torsion.cpp:133
char TorsionID[20]
Definition: ccp4srs_torsion.h:48
int atom_4
Definition: ccp4srs_torsion.h:79
int atom_3
Definition: ccp4srs_torsion.h:79
Definition: ccp4srs_angle.cpp:42
Definition: ccp4srs_container.h:48
TorsionID torsion_id
torsion angle id
Definition: ccp4srs_torsion.h:77
mmdb::cpstr id()
Definition: ccp4srs_torsion.h:56
Torsion()
Definition: ccp4srs_torsion.cpp:46
int atom_2
ordinal numbers of atoms
Definition: ccp4srs_torsion.h:78
mmdb::realtype torsion_esd
Definition: ccp4srs_torsion.h:82
int period()
Definition: ccp4srs_torsion.h:61
int atom3()
Definition: ccp4srs_torsion.h:59
mmdb::realtype value()
Definition: ccp4srs_torsion.h:62
mmdb::realtype esd()
Definition: ccp4srs_torsion.h:63