RNAMake
Public Member Functions | List of all members
Atom Class Reference

#include <atom.h>

Public Member Functions

 Atom (String const &name, Point const &coords)
 
 Atom (String const &s)
 
 Atom (Atom const &a)
 
String to_str ()
 
String to_pdb_str (int)
 
String const & name () const
 
Point const coords () const
 
void coords (Point const &ncoords)
 
void name (String const &nname)
 

Detailed Description

Stores atomic information from pdb file, design is to be extremely lightweight only storing the atom name and coordinates.

Example Usage:

// creation
auto a = Atom("P", Point(0, 1, 2));
//copy
auto a2 = Atom(a);

Constructor & Destructor Documentation

Atom::Atom ( String const &  name,
Point const &  coords 
)
inline

Standard constructor for Atom object.

Parameters
namename of atom
coords3d coordinates of atom's position
Atom::Atom ( String const &  s)
inline

Construction from String, used in reading data from files

Parameters
sstring generated from to_str()
See also
to_str()

Example Usage:

auto a = Atom("P", Point(0, 1, 2));
auto s = a.to_str();
auto a2 = Atom(s);
Atom::Atom ( Atom const &  a)
inline

Copy constructor

Parameters
aatom object to from

Member Function Documentation

Point const Atom::coords ( ) const
inline

Accessor for coords_

void Atom::coords ( Point const &  ncoords)
inline

Setter for coords_

String const& Atom::name ( ) const
inline

Accessor for name_

void Atom::name ( String const &  nname)
inline

Setter for name_

String Atom::to_pdb_str ( int  acount)

Strigifies atom into PDB format

Parameters
acountthe number of the atom, default=1
auto a = Atom("P", Point(0, 1, 2));
std::cout << a.to_pdb_str() << std::endl;
//EXPECTED OUTPUT
"ATOM 1 P C A 1 1.000 2.000 3.000 1.00 62.18 P
String Atom::to_str ( )

Strigifies atom object

auto a = Atom("P", Point(0, 1, 2));
std::cout << a.to_str() << std::endl;
//EXPECTED OUTPUT
"H1 0.0 1.0 2.0"

The documentation for this class was generated from the following files: