RNAMake
atom.h
1 
2 #ifndef __RNAMake__atom__
3 #define __RNAMake__atom__
4 
5 #include <stdio.h>
6 
7 //RNAMake Headers
8 #include "base/types.h"
9 #include "math/xyz_vector.h"
10 
26 class Atom {
27 public:
28 
34  inline
36  String const & name,
37  Point const & coords):
38  name_ ( name ),
39  coords_ ( coords )
40  {}
41 
54  inline
56  String const & s) {
57 
58  auto spl = split_str_by_delimiter(s, " ");
59  name_ = spl[0];
60  coords_ = Point(std::stof(spl[1]), std::stof(spl[2]), std::stof(spl[3]));
61  }
62 
67  inline
69  Atom const & a):
70  name_(a.name_),
71  coords_(a.coords_)
72  {}
73 
74 public:
75 
85  String to_str();
86 
98  String to_pdb_str(int);
99 
100 public: //accessors
101 
105  inline
106  String const &
107  name() const { return name_; }
108 
112  inline
113  Point const
114  coords() const { return coords_; }
115 
116 
117 public: // setters
118 
122  inline
123  void
125  Point const & ncoords) {
126  coords_ = ncoords;
127  }
128 
132  inline
133  void
135  String const & nname) {
136  name_ = nname;
137  }
138 
139 private:
143  String name_;
144 
148  Point coords_;
149 
150 };
151 
155 typedef std::shared_ptr<Atom> AtomOP;
156 
160 typedef std::vector<AtomOP> AtomOPs;
161 
162 
163 
164 
165 #endif /* defined(__RNAMake__atom__) */
Atom(String const &name, Point const &coords)
Definition: atom.h:35
Atom(Atom const &a)
Definition: atom.h:68
String to_pdb_str(int)
Definition: atom.cc:20
String to_str()
Definition: atom.cc:15
String const & name() const
Definition: atom.h:107
Atom(String const &s)
Definition: atom.h:55
Definition: atom.h:26
Point const coords() const
Definition: atom.h:114
void name(String const &nname)
Definition: atom.h:134
void coords(Point const &ncoords)
Definition: atom.h:124