-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBead.h
220 lines (168 loc) · 3.76 KB
/
Bead.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
/*
* Bead.h
*
* Created on: Jul 19, 2012
* Author: gpolles
*
* Bead class.
* Each bead has 3 coordinates and pointers to its neighbors
* and to a domain.
* It have also some information from the pdb file
* as chainId, and betaFactor
*
*/
#ifndef BEAD_H_
#define BEAD_H_
#include <vector>
#include "Vector3d.h"
#include "common.h"
class RigidDomain;
class Bead
{
public:
Bead() : _index(0), _num_neighbors(0),_num_covBonded(0), _domain(NULL),
_isEdge(false), _coordinates(Vector3d(0,0,0)),
_atomType(""),_resNum(0),_resName(""),_hetatm(false),
_betaFactor(0.0), _pdbPosition(0), _chainId(0) {}
virtual ~Bead(){}
double distance(Bead* b){
return _coordinates.distance(b->_coordinates);
}
double distance(Bead& b){
return _coordinates.distance(b._coordinates);
}
double distanceSQ(Bead* b){
return _coordinates.distanceSQ(b->_coordinates);
}
double distanceSQ(Bead& b){
return _coordinates.distanceSQ(b._coordinates);
}
RigidDomain* getDomain() const {
return _domain;
}
void setDomain(RigidDomain* domain){
_domain = domain;
}
int getIndex() const {
return _index;
}
bool getHet() {
return _hetatm;
}
void setHet(bool HET) {
_hetatm=HET;
}
void setIndex(int index) {
_index = index;
}
std::vector<Bead*>& getNeighbors() {
return _neighbors;
}
void setNeighbors(std::vector<Bead*> neighbors) {
_neighbors = neighbors;
}
int getNumNeighbors() const {
return _num_neighbors;
}
void setNumNeighbors(int numNeighbors) {
_num_neighbors = numNeighbors;
}
void addNeighbor(Bead* neighbor){
_neighbors.push_back(neighbor);
_num_neighbors = _neighbors.size();
}
/************************/
std::vector<Bead*>& getCovBonded() {
return _covBonded;
}
void setCovBonded(std::vector<Bead*> covBonded) {
_covBonded = covBonded;
}
int getNumCovBonded() const {
return _num_covBonded;
}
void setNumCovBonded(int numCovBonded) {
_num_covBonded = numCovBonded;
}
void addCovBond(Bead* covbond){
_covBonded.push_back(covbond);
_num_covBonded = _covBonded.size();
}
/***********************/
bool isEdge(){
return _isEdge;
}
void setEdge(bool b){
_isEdge =b;
}
double getBetaFactor() const {
return _betaFactor;
}
void setBetaFactor(double betaFactor) {
_betaFactor = betaFactor;
}
//#####################################
std::string getAtomType() {
return _atomType;
}
void setAtomType(std::string type) {
_atomType=type;
}
int getBeadType() {
return _beadType;
}
void setBeadType(int type) {
_beadType=type;
}
std::string getResName() {
return _resName;
}
void setResName(std::string name) {
_resName=name;
}
int getResNum() {
return _resNum;
}
void setResNum(int resnum) {
_resNum=resnum;
}
//####################################
const Vector3d& getCoordinates() const {
return _coordinates;
}
void setCoordinates(const Vector3d& coordinates) {
_coordinates = coordinates;
}
int getPdbPosition() const {
return _pdbPosition;
}
void setPdbPosition(int pdbPosition) {
_pdbPosition = pdbPosition;
}
int getChainId() const {
return _chainId;
}
void setChainId(int chainId) {
_chainId = chainId;
}
private:
int _index;
int _num_neighbors;
int _num_covBonded;
RigidDomain* _domain;
std::vector<Bead*> _neighbors;
std::vector<Bead*> _covBonded;
bool _isEdge;
Vector3d _coordinates;
double _betaFactor;
int _pdbPosition;
bool _hetatm;
int _beadType; // 0 -> P
// 1 -> sugar
// 2 -> base
std::string _atomType;
std::string _resName;
int _resNum;
int _chainId;
};
#endif /* BEAD_H_ */