File size: 1,067 Bytes
8efb4bd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#include "Particle.h"
#include "PDB.h"

Particle::Particle(): pos() {};
Particle::Particle(const Vector3& newPos) : pos(newPos) {};
Particle::Particle(const char* const PDBrec) :
  pos(PDB::atomXCoord(PDBrec), 
      PDB::atomYCoord(PDBrec),
      PDB::atomZCoord(PDBrec)) {}  


Vector3 Particle::position() const { 
  return pos;
}
  
void Particle::moveto(const Vector3 &v) {
  pos=v;
}

Particle::operator Vector3() const {
  return pos;
}

Particle::operator const Vector3&() const
{
  return pos;
}
 					  
Particle& Particle::operator*=(const Matrix3& lt) { 
  pos = lt*pos;
  return *this;
}

Particle& Particle::operator*=(const RigidTrans3& rt) { 
  pos = rt*pos; 
  return *this;
}

Particle& Particle::operator+=(const Vector3 &v) {
  pos+=v;
  return *this;
}

Particle& Particle::operator-=(const Vector3 &v) {
  pos-=v;
  return *this;
}

Particle& Particle::operator*=(const float &m) {
  pos*=m;
  return *this;
}

Particle& Particle::operator/=(const float &m) {
  pos/=m;
  return *this;
}