RxDock 0.1.0
A fast, versatile, and open-source program for docking ligands to proteins and nucleic acids
Loading...
Searching...
No Matches
NonBondedGrid.h
1/***********************************************************************
2 * The rDock program was developed from 1998 - 2006 by the software team
3 * at RiboTargets (subsequently Vernalis (R&D) Ltd).
4 * In 2006, the software was licensed to the University of York for
5 * maintenance and distribution.
6 * In 2012, Vernalis and the University of York agreed to release the
7 * program as Open Source software.
8 * This version is licensed under GNU-LGPL version 3.0 with support from
9 * the University of Barcelona.
10 * http://rdock.sourceforge.net/
11 ***********************************************************************/
12
13// Grid for indexing lipophilic interactions
14
15#ifndef _RBTNONBONDEDGRID_H_
16#define _RBTNONBONDEDGRID_H_
17
18#include "rxdock/Atom.h"
19#include "rxdock/BaseGrid.h"
20
21#include <nlohmann/json.hpp>
22
23using json = nlohmann::json;
24
25namespace rxdock {
26
27// A map of atom vectors indexed by unsigned int
28// Used to store the receptor atom lists at each grid point
29// DM 11 Jul 2000 - use map of regular Atom* list (not AtomPtr smart
30// pointer list)
31
32// DM 3 Nov 2000 - replace map by vector for faster lookup
33// typedef std::map<UInt,AtomRList> AtomListMap;
34typedef std::vector<AtomRList> AtomListMap;
35
36typedef AtomListMap::iterator AtomListMapIter;
37typedef AtomListMap::const_iterator AtomListMapConstIter;
38
39class NonBondedGrid : public BaseGrid {
40public:
41 // Class type string
42 static const std::string _CT;
44 // Constructors/destructors
45 // Construct a NXxNYxNZ grid running from gridMin at gridStep resolution
46 NonBondedGrid(const Coord &gridMin, const Coord &gridStep, unsigned int NX,
47 unsigned int NY, unsigned int NZ, unsigned int NPad = 0);
48
49 // Constructor reading all params from binary stream
50 NonBondedGrid(json j);
51
52 ~NonBondedGrid(); // Default destructor
53
54 /*friend void to_json(json &j, const NonBondedGrid &nonBondedGrid);
55 friend void from_json(const json &j, NonBondedGrid &nonBondedGrid);*/
56
57 // Copy constructor
59 // Copy constructor taking base class argument
60 NonBondedGrid(const BaseGrid &);
61 // Copy assignment
62 NonBondedGrid &operator=(const NonBondedGrid &);
63 // Copy assignment taking base class argument
64 NonBondedGrid &operator=(const BaseGrid &);
65
67 // Virtual functions for reading/writing grid data to streams in
68 // text and binary format
69 // Subclasses should provide their own private OwnPrint
70 // method to handle subclass data members, and override the public
71 // Print method
72 virtual void Print(std::ostream &ostr) const; // Text output
74 // Public methods
76
78 // Get attribute functions
80 // AtomList GetAtomList(UInt iXYZ) const;
81 // AtomList GetAtomList(const Coord& c) const;
82 const AtomRList &GetAtomList(unsigned int iXYZ) const;
83 const AtomRList &GetAtomList(const Coord &c) const;
84
86 // Set attribute functions
88 void SetAtomLists(Atom *pAtom, double radius);
89 void ClearAtomLists();
90 void UniqueAtomLists();
91
92protected:
94 // Protected methods
96 // Protected method for writing data members for this class to text stream
97 void OwnPrint(std::ostream &ostr) const;
98
99private:
101 // Private methods
103 NonBondedGrid(); // Disable default constructor
104
105 // Helper function called by copy constructor and assignment operator
106 void CopyGrid(const NonBondedGrid &);
107 // DM 6 Nov 2000 - create AtomListMap of the appropriate size
108 void CreateMap();
109
110protected:
112 // Protected data
114
115private:
117 // Private data
119 AtomListMap
120 m_atomMap; // Used to store the receptor atom lists at each grid point
121 const AtomRList m_emptyList; // Dummy list used by GetAtomList
122};
123
124/*void to_json(json &j, const NonBondedGrid &nonBondedGrid);
125void from_json(const json &j, NonBondedGrid &nonBondedGrid);*/
126
127// Useful typedefs
128typedef SmartPtr<NonBondedGrid> NonBondedGridPtr; // Smart pointer
129
130} // namespace rxdock
131
132#endif //_RBTNONBONDEDGRID_H_
Definition Atom.h:49
Definition BaseGrid.h:27
Definition Coord.h:45
Definition NonBondedGrid.h:39
Definition SmartPointer.h:48