Loading...
Searching...
No Matches
BALL::AtomVector Class Reference
Molecular Modeling » Molecular Mechanics » General Force Field Classes.

`#include <BALL/MOLMEC/COMMON/atomVector.h>`

Inheritance diagram for BALL::AtomVector:

## Public Types

Type definitions
typedef std::vector< Atom * >::iterator | Iterator
typedef std::vector< Atom * >::const_iterator | ConstIterator

## Public Member Functions

Constructors and Destructors
| AtomVector ()
| AtomVector (const Composite &composite, bool selected_only=false)
| AtomVector (const AtomVector &atoms, bool deep=true)
virtual | ~AtomVector ()
Assignments
const AtomVector & | operator= (const AtomVector &rhs)
void | set (const AtomVector &atoms)
const AtomVector & | operator= (const Composite &rhs)
void | set (const Composite &composite, bool selected_only=false)
Accessors
Atom *& | operator[] (int i)
| Random access operator.
Atom *const & | operator[] (int i) const
void | savePositions ()
void | resetPositions ()
void | moveTo (const Gradient &direction, double step=1.0)
void | moveTo (const Gradient &direction, double step, Size k)
void | resize (Size new_size)

## Iteration

std::vector< Vector3 > | saved_position_
iterator | begin ()
const_iterator | begin () const
iterator | end ()
const_iterator | end () const

## Detailed Description

Atom vector class. This class is used to store atom pointers.

Definition at line 29 of file atomVector.h.

## Member Typedef Documentation

## ConstIterator

typedef std::vector<Atom*>::const_iterator BALL::AtomVector::ConstIterator

Const iterator type.

Definition at line 46 of file atomVector.h.

## Iterator

typedef std::vector<Atom*>::iterator BALL::AtomVector::Iterator

Iterator type

Definition at line 42 of file atomVector.h.

## Constructor & Destructor Documentation

## AtomVector() [1/3]

BALL::AtomVector::AtomVector | ( |  | ) |

Default constructor.

## AtomVector() [2/3]

BALL::AtomVector::AtomVector | ( | const Composite & | composite,
|  | bool | selected_only = false )

Construct from a Composite. This method constructs an AtomVector from a given composite using selection or not.

Parameters

  composite | the composite containing the atoms
  selected_only | store the selected atoms only (if true)

## AtomVector() [3/3]

BALL::AtomVector::AtomVector | ( | const AtomVector & | atoms,
|  | bool | deep = true )

Copy constructor

## ~AtomVector()

virtual BALL::AtomVector::~AtomVector | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## begin() [1/2]

iterator BALL::AtomVector::begin | ( |  | ) |

inline

Return an iterator, pointing to the first atom pointer.

Definition at line 169 of file atomVector.h.

## begin() [2/2]

const_iterator BALL::AtomVector::begin | ( |  | ) | const

inline

Definition at line 170 of file atomVector.h.

## end() [1/2]

iterator BALL::AtomVector::end | ( |  | ) |

inline

Return an iterator, pointing behind the last atom pointer.

Definition at line 175 of file atomVector.h.

## end() [2/2]

const_iterator BALL::AtomVector::end | ( |  | ) | const

inline

Definition at line 176 of file atomVector.h.

## moveTo() [1/2]

void BALL::AtomVector::moveTo | ( | const Gradient & | direction,
|  | double | step,
|  | Size | k )

Move the first k atoms along a direction vector. The method translates all atoms a long a given direction. The direction vector is multiplied with a step length step. If a saved position exists ( savePositions() ), it is used as a start position (i.e. the final positions are $\vec{\mathrm{start}} + \mathrm{step} \vec{\mathrm{direction}}$). Otherwise, the current atom positions are used. If the gradient's size differs from the number of atoms, nothing is done.

## moveTo() [2/2]

void BALL::AtomVector::moveTo | ( | const Gradient & | direction,
|  | double | step = 1.0 )

Move all atoms along a direction vector. The method translates all atoms a long a given direction. The direction vector is multiplied with a step length step. If a saved position exists ( savePositions() ), it is used as a start position (i.e. the final positions are $\vec{\mathrm{start}} + \mathrm{step} \vec{\mathrm{direction}}$). Otherwise, the current atom positions are used. If the gradient's size differs from the number of atoms, nothing is done.

## operator=() [1/2]

const AtomVector & BALL::AtomVector::operator= | ( | const AtomVector & | rhs | ) |

Assignment operator

## operator=() [2/2]

const AtomVector & BALL::AtomVector::operator= | ( | const Composite & | rhs | ) |

Assignment operator for Composites. Calls set() and extracts all atoms, if none of the atoms in composite are selected or the selected atoms only (if any atom is selected in composite.

See also
  Selectable

## operator[]() [1/2]

Atom *& BALL::AtomVector::operator[] | ( | int | i | ) |

inline

Random access operator.

Definition at line 115 of file atomVector.h.

## operator[]() [2/2]

Atom *const & BALL::AtomVector::operator[] | ( | int | i | ) | const

inline

Definition at line 116 of file atomVector.h.

## resetPositions()

void BALL::AtomVector::resetPositions | ( |  | ) |

Resets the atom positions to the saved positions. If coordinates weres stored using savePositions() , the atoms coordinates are reset to the saved positions. If no savedPositions exist the coordinates remain unchanged.

## resize()

void BALL::AtomVector::resize | ( | Size | new_size | ) |

Resize the vector. If the vector is resized to to more elements, than are contained, it is filled with NullPointers.

## savePositions()

void BALL::AtomVector::savePositions | ( |  | ) |

Store the current atom positions. AtomVector also contains an array with positions for each atom. moveTo() considers these coordinates as start coordinates.

## set() [1/2]

void BALL::AtomVector::set | ( | const AtomVector & | atoms | ) |

Assign from another atom vector

## set() [2/2]

void BALL::AtomVector::set | ( | const Composite & | composite,
|  | bool | selected_only = false )

Assign from a composite. This method iterates over the composite tree and extracts all atoms.

Parameters

  selected_only | extract only selected atoms if set to true

## Member Data Documentation

## saved_position_

std::vector<Vector3> BALL::AtomVector::saved_position_

protected

Definition at line 184 of file atomVector.h.