BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
atomVector.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 // $Id: atomVector.h,v 1.24.20.1 2007/05/18 12:02:43 oliver Exp $
5 //
6 
7 #ifndef BALL_MOLMEC_COMMON_ATOMVECTOR_H
8 #define BALL_MOLMEC_COMMON_ATOMVECTOR_H
9 
10 #ifndef BALL_COMMON_H
11 # include <BALL/common.h>
12 #endif
13 
14 #ifndef BALL_MATHS_VECTOR3_H
15 # include <BALL/MATHS/vector3.h>
16 #endif
17 
18 namespace BALL
19 {
20  class Gradient;
21  class Atom;
22  class Composite;
23 
30  : private std::vector<Atom*>
31  {
32  public:
33 
35 
36 
39 
40 
42  typedef std::vector<Atom*>::iterator Iterator;
43 
46  typedef std::vector<Atom*>::const_iterator ConstIterator;
47 
49 
52 
55  AtomVector();
56 
63  AtomVector(const Composite& composite, bool selected_only = false);
64 
67  AtomVector(const AtomVector& atoms, bool deep = true);
68 
71  virtual ~AtomVector();
72 
76  using std::vector<Atom*>::clear;
78 
82 
85  const AtomVector& operator = (const AtomVector& rhs);
86 
89  void set(const AtomVector& atoms);
90 
97  const AtomVector& operator = (const Composite& rhs);
98 
103  void set(const Composite& composite, bool selected_only = false);
104 
106 
109 
112  using std::vector<Atom*>::size;
113 
115  Atom* & operator [] (int i) { return std::vector<Atom*>::operator [] (i); }
116  Atom* const & operator [] (int i) const { return std::vector<Atom*>::operator [] (i); }
117 
122  void savePositions();
123 
129  void resetPositions();
130 
139  void moveTo(const Gradient& direction, double step = 1.0);
140 
149  void moveTo(const Gradient& direction, double step, Size k);
150 
153  using std::vector<Atom*>::push_back;
154 
159  void resize(Size new_size);
160 
162 
165 
168  //?????: GCC3 using std::vector<Atom*>::begin;
169  iterator begin() { return std::vector<Atom*>::begin(); }
170  const_iterator begin() const { return std::vector<Atom*>::begin(); }
171 
174  //?????: GCC3 using std::vector<Atom*>::end;
175  iterator end() { return std::vector<Atom*>::end(); }
176  const_iterator end() const { return std::vector<Atom*>::end(); }
177 
179 
180  protected:
181 
182  /*_ The saved positions.
183  */
184  std::vector<Vector3> saved_position_;
185  };
186 } // end of namespace BALL
187 
188 #endif // BALL_MOLMEC_MINIMIZATION_GRADIENT_H
const_iterator end() const
Definition: atomVector.h:176
std::vector< Vector3 > saved_position_
Definition: atomVector.h:184
std::vector< Atom * >::iterator Iterator
Definition: atomVector.h:42
BALL_EXPORT AtomList atoms(const AtomContainer &fragment, const String &expression=String())
iterator end()
Definition: atomVector.h:175
#define BALL_CREATE_DEEP(name)
Definition: create.h:26
BALL_EXTERN_VARIABLE const double k
Definition: constants.h:93
const_iterator begin() const
Definition: atomVector.h:170
std::vector< Atom * >::const_iterator ConstIterator
Definition: atomVector.h:46
char Atom[5]
Definition: PDBdefs.h:257
iterator begin()
Definition: atomVector.h:169
#define BALL_EXPORT
Definition: COMMON/global.h:50