ccp4srs  Version 1.0.0
ccp4srs_angle.h
Go to the documentation of this file.
1 // $Id: ccp4srs_angle.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 // 03.02.14 <-- Date of Last Modification.
26 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27 // -----------------------------------------------------------------
28 //
29 // **** Module : ccp4srs_angle <interface>
30 // ~~~~~~~~~
31 // **** Classes : ccp4srs::Angle - angle restraint class
32 // ~~~~~~~~~
33 //
34 // (C) E. Krissinel 2010-2014
35 //
36 // =================================================================
37 //
38 
39 #ifndef CCP4SRS_ANGLE_H
40 #define CCP4SRS_ANGLE_H
41 
42 #include "ccp4srs_atom.h"
43 
44 namespace ccp4srs {
45 
46  DefineClass(Angle);
47 
48  class Angle {
49 
50  public:
51  Angle();
52  virtual ~Angle();
53 
54  inline int atom1() { return atom_1; }
55  inline int atom2() { return atom_2; }
56  inline int atom3() { return atom_3; }
57  inline mmdb::realtype value() { return angle; }
58  inline mmdb::realtype esd () { return angle_esd; }
59 
60  static void makeCIFTags ( mmdb::mmcif::PLoop mmCIFLoop );
61  int readFromCIF ( mmdb::mmcif::PLoop mmCIFLoop, int angleNo,
62  Container<Atom> & atoms );
63  void writeToCIF ( mmdb::mmcif::PLoop mmCIFLoop, mmdb::cpstr monID,
64  Container<Atom> & atoms );
65 
66  void write_mem ( PMemIO memIO, int version );
67  bool read_mem ( PMemIO memIO, int version,
68  bool * Ok = NULL );
69 
70  void copy ( PAngle ang, mmdb::ivector anmatch=NULL );
71 
72  protected:
73  int atom_1,atom_2,atom_3; // ordinal numbers of of atoms
74  // that form the angle [0,1,...]
75  mmdb::realtype angle; // angle in degrees
76  mmdb::realtype angle_esd; // angle esd in degrees; set to 0.0
77  // if not provided
78 
79  };
80 
81 } // namespace ccp4srs
82 
83 #endif // CCP4SRS_ANGLE_H
DefineClass(Angle)
int atom_3
Definition: ccp4srs_angle.h:73
bool read_mem(PMemIO memIO, int version, bool *Ok=NULL)
Definition: ccp4srs_angle.cpp:131
int readFromCIF(mmdb::mmcif::PLoop mmCIFLoop, int angleNo, Container< Atom > &atoms)
Definition: ccp4srs_angle.cpp:56
int atom1()
Definition: ccp4srs_angle.h:54
int atom2()
Definition: ccp4srs_angle.h:55
mmdb::realtype angle
Definition: ccp4srs_angle.h:75
static void makeCIFTags(mmdb::mmcif::PLoop mmCIFLoop)
Definition: ccp4srs_angle.cpp:88
void write_mem(PMemIO memIO, int version)
Definition: ccp4srs_angle.cpp:122
int atom3()
Definition: ccp4srs_angle.h:56
Angle()
Definition: ccp4srs_angle.cpp:44
void copy(PAngle ang, mmdb::ivector anmatch=NULL)
Definition: ccp4srs_angle.cpp:107
mmdb::realtype value()
Definition: ccp4srs_angle.h:57
Definition: ccp4srs_angle.cpp:42
Definition: ccp4srs_container.h:48
int atom_1
Definition: ccp4srs_angle.h:73
mmdb::realtype esd()
Definition: ccp4srs_angle.h:58
Definition: ccp4srs_angle.h:48
mmdb::realtype angle_esd
Definition: ccp4srs_angle.h:76
void writeToCIF(mmdb::mmcif::PLoop mmCIFLoop, mmdb::cpstr monID, Container< Atom > &atoms)
Definition: ccp4srs_angle.cpp:97
int atom_2
Definition: ccp4srs_angle.h:73
virtual ~Angle()
Definition: ccp4srs_angle.cpp:52