BALL  1.4.79
scoreGridSet.h
Go to the documentation of this file.
1 /* scoreGridSet.h
2 *
3 * Copyright (C) 2011 Marcel Schumann
4 *
5 * This program free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 // ----------------------------------------------------
20 // $Maintainer: Marcel Schumann $
21 // $Authors: Marcel Schumann $
22 // ----------------------------------------------------
23 
24 #ifndef BALL_SCORING_COMMON_SCOREGRIDSET
25 #define BALL_SCORING_COMMON_SCOREGRIDSET
26 
27 #include <BALL/MATHS/vector3.h>
31 
32 
33 namespace BALL
34 {
35  typedef vector<vector<vector<double> > > ScoreGrid;
36 
37  class GridBasedScoring;
38 
41  {
42  public:
45  ScoreGridSet(GridBasedScoring* gbs, Vector3& v_origin, Vector3& size, double& resolution);
46 
48 
52 
54  ScoreGridSet();
55 
56  ~ScoreGridSet();
57 
61  void operator += (ScoreGridSet& sgs);
62 
66  void operator -= (ScoreGridSet& sgs);
67 
69  void clearData();
70 
71  ScoreGrid& operator[](int i);
72 
73  void binaryWrite(std::ostream& output);
74 
75  void binaryRead(std::istream& input);
76 
77  void saveToFile(std::ostream& output, String receptor_name);
78 
79  void readFromFile(std::istream& input);
80 
81  void setHashGrid(HashGrid3<Atom*>* hashgrid);
82 
83  HashGrid3<Atom*>* getHashGrid();
84 
85  void transform(TMatrix4x4 < float > & t);
86 
88  void moveTo(Vector3& destination);
89 
92  double getGridScore(Size grid, Vector3 position, bool interpolation);
93 
94  Size sizeX();
95 
96  Size sizeY();
97 
98  Size sizeZ();
99 
100  Size noGrids();
101 
103  void enable();
104 
106  void disable();
107 
108  bool isEnabled();
109 
111  Vector3 getOrigin();
112 
114  Vector3 getCenter();
115 
118  std::list<std::pair<String, BALL::RegularData3D*> > convertToRegularData3DGrids();
119 
120  PharmacophoreConstraint* getPharmacophoreConstraint();
121 
122  void setPharmacophoreConstraint(PharmacophoreConstraint* phc);
123 
124  void setParameters(bool enforce_grid_boundaries, double out_of_grid_penalty, double interaction_no_scale);
125 
126  // -------- public members: -------------
128 
131 
133 
134  private:
135  std::map<String, int>* getAtomTypesMap();
136 
138  String getGridAtomTypeName(int grid_id);
139 
141  bool is_reference_;
142 
144  Vector3 origin_;
145 
147  Vector3 original_origin_;
148 
149  double resolution_;
150 
152  bool enforce_grid_boundaries_;
153 
155  double out_of_grid_penalty_;
156 
161  bool enabled_;
162 
163  std::vector<ScoreGrid*>* score_grids_;
164 
165  Size size_x;
166 
167  Size size_y;
168 
169  Size size_z;
170 
172  bool transformed_;
173 
174  void initializeEmptyGrids(int no = -1);
175 
177  GridBasedScoring* parent;
178 
180  bool new_hashgrid_;
181 
184 
186  TMatrix4x4<float> T_i_;
187 
188  HashGrid3<Atom*>* hashgrid_;
189 
191  std::map<BALL::String, int> atom_types_map_no_parent_;
192 
193  PharmacophoreConstraint* pharm_constraint_;
194 
195  friend class GridBasedScoring;
196  };
197 }
198 
199 #endif // BALL_SCORING_COMMON_SCOREGRIDSET
double interaction_no_scale_
Definition: scoreGridSet.h:132
-*- Mode: C++; tab-width: 2; -*-
Definition: constants.h:12
vector< vector< vector< double > > > ScoreGrid
Definition: scoreGridSet.h:35
#define BALL_EXPORT
Definition: COMMON/global.h:50