ccp4srs  Version 1.0.0
ccp4srs_plane.h
Go to the documentation of this file.
1 // $Id: ccp4srs_plane.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_plane <interface>
30 // ~~~~~~~~~
31 // **** Classes : ccp4srs::Plane - plain group of atoms
32 // ~~~~~~~~~
33 //
34 // (C) E. Krissinel 2010-2013
35 //
36 // =================================================================
37 //
38 
39 #ifndef CCP4SRS_PLANE_H
40 #define CCP4SRS_PLANE_H
41 
42 #include "ccp4srs_atom.h"
43 
44 namespace ccp4srs {
45 
46  DefineClass(Plane);
47 
48  typedef char PlaneID[20];
49 
50  class Plane {
51 
52  public:
53 
54  enum { Ok=0,EmptyLoop=-11111,NoMorePlanes=-11112 };
55 
56  Plane();
57  virtual ~Plane();
58 
59  inline mmdb::cpstr id () { return plane_id; }
60  inline int size () { return n_atoms; }
61  inline mmdb::ivector atoms() { return plane_atoms; }
62  inline mmdb::rvector esds () { return dist_esd; }
63  inline int atom ( int atomNo ) { return plane_atoms[atomNo]; }
64  inline mmdb::realtype esd ( int atomNo ) { return dist_esd [atomNo]; }
65 
66  static void makeCIFTags ( mmdb::mmcif::PLoop mmCIFLoop );
67  int readFromCIF ( mmdb::mmcif::PLoop mmCIFLoop, int planeNo,
69  void writeToCIF ( mmdb::mmcif::PLoop mmCIFLoop, mmdb::cpstr monID,
71 
72  void write_mem ( PMemIO memIO, int version );
73  bool read_mem ( PMemIO memIO, int version, bool * Ok = NULL );
74 
75  void copy ( PPlane plane, mmdb::ivector anmatch=NULL );
76 
77  protected:
78  PlaneID plane_id;
79  int n_atoms;
80  mmdb::ivector plane_atoms;
81  mmdb::rvector dist_esd;
82 
83  void empty();
84 
85  };
86 
87 } // namespace ccp4srs
88 
89 #endif // CCP4SRS_PLANE_H
void empty()
Definition: ccp4srs_plane.cpp:57
bool read_mem(PMemIO memIO, int version, bool *Ok=NULL)
Definition: ccp4srs_plane.cpp:181
DefineClass(Angle)
char PlaneID[20]
Definition: ccp4srs_plane.h:48
mmdb::realtype esd(int atomNo)
Definition: ccp4srs_plane.h:64
mmdb::rvector esds()
Definition: ccp4srs_plane.h:62
static void makeCIFTags(mmdb::mmcif::PLoop mmCIFLoop)
Definition: ccp4srs_plane.cpp:64
mmdb::ivector atoms()
Definition: ccp4srs_plane.h:61
mmdb::ivector plane_atoms
vector of plain's atom names
Definition: ccp4srs_plane.h:80
Plane()
Definition: ccp4srs_plane.cpp:46
int readFromCIF(mmdb::mmcif::PLoop mmCIFLoop, int planeNo, Container< Atom > &atoms)
Definition: ccp4srs_plane.cpp:71
void writeToCIF(mmdb::mmcif::PLoop mmCIFLoop, mmdb::cpstr monID, Container< Atom > &atoms)
Definition: ccp4srs_plane.cpp:132
Definition: ccp4srs_plane.h:54
void copy(PPlane plane, mmdb::ivector anmatch=NULL)
Definition: ccp4srs_plane.cpp:145
Definition: ccp4srs_plane.h:54
mmdb::rvector dist_esd
vector of distance esds from the plane
Definition: ccp4srs_plane.h:81
Definition: ccp4srs_plane.h:54
int n_atoms
plane size
Definition: ccp4srs_plane.h:79
Definition: ccp4srs_plane.h:50
Definition: ccp4srs_angle.cpp:42
void write_mem(PMemIO memIO, int version)
Definition: ccp4srs_plane.cpp:170
Definition: ccp4srs_container.h:48
int size()
Definition: ccp4srs_plane.h:60
virtual ~Plane()
Definition: ccp4srs_plane.cpp:53
mmdb::cpstr id()
Definition: ccp4srs_plane.h:59
int atom(int atomNo)
Definition: ccp4srs_plane.h:63
PlaneID plane_id
plane id
Definition: ccp4srs_plane.h:78