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 geom {
32  // we should really have fw headers...
33  class Transform;
34 }
35 
36 namespace ost { namespace mol {
37 
40 public:
45 
47  EntityHandle GetEntity() const;
48 
49  //EntityGroupHandle ExtractFromTo(int start, int end, int step=1);
50  //EntityGroupHandle ExtractEvery(int step, int start=0);
51 
53  uint GetAtomCount() const;
54 
56  uint GetFrameCount() const;
57 
59  float GetDelta() const;
60 
62  void SetDelta(float d);
63 
65  float GetStartTime() const;
66 
68  void SetStartTime(float t);
69 
72  void SetFramePositions(uint frame, const geom::Vec3List& clist);
73 
75  void SetFrameCellSize(uint frame, const geom::Vec3& size);
76 
78  geom::Vec3List GetFramePositions(uint frame);
79 
81  void CopyFrame(uint frame);
82 
84  void Capture();
85 
86  void CaptureInto(int pos);
87 
89  void Capture(uint frame);
90 
92  //void AddFrame(const std::vector<geom::Vec3>& clist);
93  void AddFrame(const geom::Vec3List& clist);
94  void AddFrame(const geom::Vec3List& clist,const geom::Vec3& cell_size,const geom::Vec3& cell_angles);
95 
96  void AddFrames(const CoordGroupHandle& cg);
98  void SetAtomPos(uint frame, AtomHandle atom, const geom::Vec3& pos);
99 
101  geom::Vec3 GetAtomPos(uint frame, AtomHandle atom) const;
102 
104  bool IsValid() const;
105 
107  operator bool() const;
108 
109  AtomHandleList GetAtomList() const;
110  CoordFramePtr GetFrame(uint frame) const;
111  CoordFrame GetFrame2(uint frame);
112 
115  CoordGroupHandle Filter(const EntityView& selected,int first=0,int last=-1,int stride=1) const;
116 
118  void ApplyTransform(const geom::Transform& tf);
119 
120 
121 private:
122  void CheckValidity() const;
123  CoordSourcePtr source_;
124 };
125 
126 // factory method
127 // create with a reference set of atoms and zero frames
129 
130 }} // ns
131 
132 #endif
coordinate group, for trajectories and such
Definition: coord_group.hh:39
Handle to atom datatype.
Definition: atom_handle.hh:37
Protein or molecule.
DLLEXPORT_OST_MOL CoordGroupHandle CreateCoordGroup(const AtomHandleList &atoms)
ImageStateConstModOPAlgorithm< TransformFnc > Transform
boost::shared_ptr< CoordSource > CoordSourcePtr
Definition: coord_source.hh:37
boost::shared_ptr< CoordFrame > CoordFramePtr
Definition: coord_frame.hh:206
basic and essential transformation class, including translation, rotation and center of rotation ...
Definition: transform.hh:39
Three dimensional vector class, using Real precision.
Definition: vec3.hh:42
#define DLLEXPORT_OST_MOL
std::vector< AtomHandle > AtomHandleList
definition of EntityView
Definition: entity_view.hh:86
unsigned int uint
Definition: base.hh:29