-
Notifications
You must be signed in to change notification settings - Fork 2
/
RotatableBond.cpp
56 lines (45 loc) · 1.08 KB
/
RotatableBond.cpp
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
#include "RotatableBond.h"
#include <openbabel/mol.h>
#include <openbabel/obconversion.h>
RotatableBond::RotatableBond(string piType, vector<OBAtom*> piAtoms, vector<double> piAngles)
{
this->type = piType;
this->atoms = piAtoms;
this->angles = piAngles;
}
RotatableBond::~RotatableBond()
{
}
// Methods
void RotatableBond::addAngle(double piAngle) {
this->angles.push_back(piAngle);
}
void RotatableBond::removeAngle(unsigned int piPosition) {
vector<double>::iterator itVector = this->angles.begin();
for (unsigned int i = 0; i < angles.size(); i++) {
if (i == piPosition) {
this->angles.erase(itVector);
break;
} else {
itVector++;
}
}
}
string RotatableBond::getType() {
return type;
}
vector<OBAtom*> RotatableBond::getAtoms() {
return atoms;
}
vector<double> RotatableBond::getAngles() {
return angles;
}
void RotatableBond::setType(string piType) {
this->type = piType;
}
void RotatableBond::setAngles(vector<double> piAngles) {
this->angles = piAngles;
}
void RotatableBond::updateAtom(unsigned int piPosition, OBAtom* piAtom) {
atoms[piPosition] = piAtom;
}