Atom Class Template Reference

A minimal Atom class. More...

#include <atom.hpp>

Inheritance diagram for Atom:

ChemicallyTypedObject< TS, TS::atom_dictionary > boost::less_than_comparable List of all members.

Public Types

typedef base_type::dictionary atom_dictionary
 The type of the atom dictionary.
typedef id_type atom_id_type
 The type of the atom ID for this class (same as the ID type).
typedef chemical_type_system::element_dictionary element_dictionary
 The type of the element dictionary.
typedef chemical_type_system::element_id_type element_id_type
 The type of the element ID for this class.
typedef TS chemical_type_system
 The type of the ChemicalTypeSystem for this class.
typedef base_type::dictionary dictionary
 The type of the dictionary for this class.
typedef base_type::id_type id_type
 The ID type for this class (same as the atom ID type).

Public Member Functions

 Atom ()
 Default constructor.
 Atom (BTK::MATH::BTKVector const &pos, atom_id_type type, element_id_type etype, int number=0, chemical_type_system const &ts=chemical_type_system())
 Construct from data.
 Atom (self_type const &src)
 Copy constructor.
virtual ~Atom ()
virtual dictionary const & get_dictionary () const
virtual dictionaryget_dictionary ()
element_id_type element_type () const
 Get the element type.
void set_element_type (element_id_type et)
 Set the element type.
std::string element_name () const
 Get the element name.
int number () const
 Get the atom number.
void set_number (int number)
 Set the atom number.
BTK::MATH::BTKVector const & position () const
 Get the atom position.
void set_position (BTK::MATH::BTKVector const &position)
 Set the atom position.
bool selected () const
 Is this atom selected?
void select (bool s=true) const
 Set the selection flag for this atom.
virtual std::ostream & print (std::ostream &os, int atom_number=1, int group_number=1, char chain_id= ' ', std::string const &group_name="", bool is_hetatom=false, char alt_loc= ' ', char i_code= ' ', double occupancy=1.0, double b_factor=1.0, std::string const &seg_id="", std::string const &element_name="", std::string const &charge="") const
 Print an atom to a stream, in PDB format.
self_type const & operator= (self_type const &src)
 Assignment operator.
bool operator== (self_type const &rhs) const
 Test atom equality.
bool operator!= (self_type const &rhs) const
 Test atom inequality.

Detailed Description

template<typename TS = BTK::IO::DefaultTypeSystem>
class BTK::ATOMS::Atom< TS >

A minimal Atom class.

Todo:
Make this class abstract, so that decorated atoms cannot be used in mixed-type assignments.
This is a lightweight class that meets all of the requirements of the AtomConcept. It is intended to be a base class for further decoration and customization by the user of the library.

Element and atom types are enforced at compile time through the use of TypeSystem objects, which specify the atom and element ID types used by Atom, as well as the type dictionaries used to associate ID values to atom and element names. If not specified by the user, every Atom uses the DefaultTypeSystem object, which is a generic TypeSystem that provides dynamic name resolution for atom types.


Member Typedef Documentation

typedef TS chemical_type_system

The type of the ChemicalTypeSystem for this class.

Reimplemented from ChemicallyTypedObject< TS, TS::atom_dictionary >.

typedef base_type::dictionary dictionary

The type of the dictionary for this class.

Reimplemented from ChemicallyTypedObject< TS, TS::atom_dictionary >.

typedef base_type::id_type id_type

The ID type for this class (same as the atom ID type).

Reimplemented from ChemicallyTypedObject< TS, TS::atom_dictionary >.

typedef base_type::dictionary atom_dictionary

The type of the atom dictionary.

typedef id_type atom_id_type

The type of the atom ID for this class (same as the ID type).

typedef chemical_type_system::element_dictionary element_dictionary

The type of the element dictionary.

typedef chemical_type_system::element_id_type element_id_type

The type of the element ID for this class.


Constructor & Destructor Documentation

Atom (  ) 

Default constructor.

Atom ( BTK::MATH::BTKVector const &  pos,
atom_id_type  type,
element_id_type  etype,
int  number = 0,
chemical_type_system const &  ts = chemical_type_system() 
)

Construct from data.

Parameters:
pos The position of the atom.
type The type of the atom.
element_type The element type of the atom.
number The number/index of the atom.
ts An instance of the TypeSystem for this Atom class.

Atom ( self_type const &  src  ) 

Copy constructor.

virtual ~Atom (  )  [virtual]


Member Function Documentation

virtual dictionary const& get_dictionary (  )  const [virtual]

Implements ChemicallyTypedObject< TS, TS::atom_dictionary >.

virtual dictionary& get_dictionary (  )  [virtual]

Implements ChemicallyTypedObject< TS, TS::atom_dictionary >.

element_id_type element_type (  )  const

Get the element type.

void set_element_type ( element_id_type  et  ) 

Set the element type.

std::string element_name (  )  const

Get the element name.

int number (  )  const

Get the atom number.

void set_number ( int  number  ) 

Set the atom number.

BTK::MATH::BTKVector const& position (  )  const

Get the atom position.

void set_position ( BTK::MATH::BTKVector const &  position  ) 

Set the atom position.

bool selected (  )  const

Is this atom selected?

void select ( bool  s = true  )  const

Set the selection flag for this atom.

virtual std::ostream& print ( std::ostream &  os,
int  atom_number = 1,
int  group_number = 1,
char  chain_id = ' ',
std::string const &  group_name = "",
bool  is_hetatom = false,
char  alt_loc = ' ',
char  i_code = ' ',
double  occupancy = 1.0,
double  b_factor = 1.0,
std::string const &  seg_id = "",
std::string const &  element_name = "",
std::string const &  charge = "" 
) const [virtual]

Print an atom to a stream, in PDB format.

Deprecated:
Todo:
Simplify the stream output system. PDB-formatted output should be relegated to specialized PDB classes, so that simple classes (like Atom) don't have to have complicated methods (like Atom::print()) that are only complex due to PDB output requirements.

self_type const& operator= ( self_type const &  src  ) 

Assignment operator.

Todo:
The Atom class should be made abstract, and the assignment operator protected.

bool operator== ( self_type const &  rhs  )  const

Test atom equality.

Two atoms are equivalent iff their types and positions are equivalent.

bool operator!= ( self_type const &  rhs  )  const

Test atom inequality.


The documentation for this class was generated from the following file:
Generated on Sun Jul 15 20:46:33 2007 for BTK Core by  doxygen 1.5.1