00001
00002
00003
00004
00005
00006
00007 #ifndef BALL_MOLMEC_COMMON_ATOMVECTOR_H
00008 #define BALL_MOLMEC_COMMON_ATOMVECTOR_H
00009
00010 #ifndef BALL_COMMON_H
00011 # include <BALL/common.h>
00012 #endif
00013
00014 #ifndef BALL_MATHS_VECTOR3_H
00015 # include <BALL/MATHS/vector3.h>
00016 #endif
00017
00018 namespace BALL
00019 {
00020 class Gradient;
00021 class Atom;
00022 class Composite;
00023
00029 class BALL_EXPORT AtomVector
00030 : private std::vector<Atom*>
00031 {
00032 public:
00033
00034 BALL_CREATE_DEEP(AtomVector)
00035
00036
00039
00040
00042 typedef std::vector<Atom*>::iterator Iterator;
00043
00046 typedef std::vector<Atom*>::const_iterator ConstIterator;
00047
00049
00052
00055 AtomVector();
00056
00063 AtomVector(const Composite& composite, bool selected_only = false);
00064
00067 AtomVector(const AtomVector& atoms, bool deep = true);
00068
00071 virtual ~AtomVector();
00072
00076 using std::vector<Atom*>::clear;
00078
00082
00085 const AtomVector& operator = (const AtomVector& rhs);
00086
00089 void set(const AtomVector& atoms);
00090
00097 const AtomVector& operator = (const Composite& rhs);
00098
00103 void set(const Composite& composite, bool selected_only = false);
00104
00106
00109
00112 using std::vector<Atom*>::size;
00113
00115 Atom* & operator [] (int i) { return std::vector<Atom*>::operator [] (i); }
00116 Atom* const & operator [] (int i) const { return std::vector<Atom*>::operator [] (i); }
00117
00122 void savePositions();
00123
00129 void resetPositions();
00130
00139 void moveTo(const Gradient& direction, double step = 1.0);
00140
00149 void moveTo(const Gradient& direction, double step, Size k);
00150
00153 using std::vector<Atom*>::push_back;
00154
00159 void resize(Size new_size);
00160
00162
00165
00168
00169 iterator begin() { return std::vector<Atom*>::begin(); }
00170 const_iterator begin() const { return std::vector<Atom*>::begin(); }
00171
00174
00175 iterator end() { return std::vector<Atom*>::end(); }
00176 const_iterator end() const { return std::vector<Atom*>::end(); }
00177
00179
00180 protected:
00181
00182
00183
00184 std::vector<Vector3> saved_position_;
00185 };
00186 }
00187
00188 #endif // BALL_MOLMEC_MINIMIZATION_GRADIENT_H