OpenStructure
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
coord_group.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // This file is part of the OpenStructure project <www.openstructure.org>
3 //
4 // Copyright (C) 2008-2011 by the OpenStructure authors
5 //
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License as published by the Free
8 // Software Foundation; either version 3.0 of the License, or (at your option)
9 // any later version.
10 // This library is distributed in the hope that it will be useful, but WITHOUT
11 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 // details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with this library; if not, write to the Free Software Foundation, Inc.,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 //------------------------------------------------------------------------------
19 #ifndef OST_COORD_GROUP_HH
20 #define OST_COORD_GROUP_HH
21 
22 /*
23  Author: Ansgar Philippsen, Marco Biasini
24 */
25 
26 #include <vector>
27 #include <boost/shared_array.hpp>
28 #include "atom_handle.hh"
29 #include "coord_source.hh"
30 
31 namespace ost { namespace mol {
32 
35 public:
38 
40  EntityHandle GetEntity() const;
41 
42  //EntityGroupHandle ExtractFromTo(int start, int end, int step=1);
43  //EntityGroupHandle ExtractEvery(int step, int start=0);
44 
46  uint GetAtomCount() const;
47 
49  uint GetFrameCount() const;
50 
53  void SetFramePositions(uint frame, const std::vector<geom::Vec3>& clist);
54 
56  geom::Vec3List GetFramePositions(uint frame);
57 
59  void CopyFrame(uint frame);
60 
62  void Capture();
63 
64  void CaptureInto(int pos);
65 
67  void Capture(uint frame);
68 
70  //void AddFrame(const std::vector<geom::Vec3>& clist);
71  void AddFrame(const geom::Vec3List& clist);
72  void AddFrame(const geom::Vec3List& clist,const geom::Vec3& cell_size,const geom::Vec3& cell_angles);
73 
74  void AddFrames(const CoordGroupHandle& cg);
76  void SetAtomPos(uint frame, AtomHandle atom, const geom::Vec3& pos);
77 
79  geom::Vec3 GetAtomPos(uint frame, AtomHandle atom) const;
80 
82  bool IsValid() const;
83 
85  operator bool() const;
86 
87  AtomHandleList GetAtomList() const;
88  CoordFramePtr GetFrame(uint frame) const;
89  CoordFrame GetFrame2(uint frame);
90 
93  CoordGroupHandle Filter(const EntityView& selected,int first=0,int last=-1) const;
94 
96 
97 
98 private:
99  void CheckValidity() const;
100  CoordSourcePtr source_;
101 };
102 
103 // factory method
104 // create with a reference set of atoms and zero frames
106 
107 }} // ns
108 
109 #endif