OpenStructure
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-2020 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 
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 
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 
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 
112 
115  CoordGroupHandle Filter(const EntityView& selected,int first=0,int last=-1,int stride=1) const;
116 
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
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:48
Handle to atom datatype.
Definition: atom_handle.hh:37
coordinate group, for trajectories and such
Definition: coord_group.hh:39
void Capture()
store current atom positions in new frame
void AddFrames(const CoordGroupHandle &cg)
void SetDelta(float d)
set time between each frame in ps
void AddFrame(const geom::Vec3List &clist, const geom::Vec3 &cell_size, const geom::Vec3 &cell_angles)
uint GetAtomCount() const
number of atoms per frame
geom::Vec3 GetAtomPos(uint frame, AtomHandle atom) const
retrieve an indidivial atom position in the given frame
CoordFramePtr GetFrame(uint frame) const
void SetFrameCellSize(uint frame, const geom::Vec3 &size)
set cell size for the given frame
CoordFrame GetFrame2(uint frame)
CoordGroupHandle(CoordSourcePtr source)
used internally
void SetFramePositions(uint frame, const geom::Vec3List &clist)
assign positions to the given frame - order and count must match initial atomlist
void AddFrame(const geom::Vec3List &clist)
add frame
void Capture(uint frame)
store current atom positions in given frame (must exist)
EntityHandle GetEntity() const
return trajectories entity handle
geom::Vec3List GetFramePositions(uint frame)
get the positions of all the atoms in the given frame
float GetDelta() const
time in ps between frames, default 0.0
void SetStartTime(float t)
set start time in ps
float GetStartTime() const
start time in ps, default 0.0
uint GetFrameCount() const
number of frames
void CopyFrame(uint frame)
copy atom positions of given frame to stored atoms in entity
void ApplyTransform(const geom::Transform &tf)
apply in-place transform to each coordinate in each frame
bool IsValid() const
check for handle validity
CoordGroupHandle Filter(const EntityView &selected, int first=0, int last=-1, int stride=1) const
return a filtered coord group, containing only the atoms in the view
void SetAtomPos(uint frame, AtomHandle atom, const geom::Vec3 &pos)
set an indidivial atom position in the given frame
AtomHandleList GetAtomList() const
CoordGroupHandle()
create empty, invalid handle
Protein or molecule.
definition of EntityView
Definition: entity_view.hh:86
unsigned int uint
Definition: base.hh:29
#define DLLEXPORT_OST_MOL
ImageStateConstModOPAlgorithm< TransformFnc > Transform
std::vector< AtomHandle > AtomHandleList
DLLEXPORT_OST_MOL CoordGroupHandle CreateCoordGroup(const AtomHandleList &atoms)
boost::shared_ptr< CoordSource > CoordSourcePtr
Definition: coord_source.hh:37
boost::shared_ptr< CoordFrame > CoordFramePtr
Definition: coord_frame.hh:206
Definition: base.dox:1