00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef OST_MOL_COORD_SOURCE_HH
00020 #define OST_MOL_COORD_SOURCE_HH
00021
00022
00023
00024
00025 #include <boost/shared_ptr.hpp>
00026 #include <ost/mol/module_config.hh>
00027 #include <ost/mol/coord_frame.hh>
00028 #include <ost/mol/entity_handle.hh>
00029
00030
00031 namespace ost { namespace mol {
00032
00033 class CoordSource;
00034
00035 typedef boost::shared_ptr<CoordSource> CoordSourcePtr;
00036
00042 class DLLEXPORT_OST_MOL CoordSource {
00043 public:
00044 CoordSource(const AtomHandleList& atoms);
00045
00046 virtual ~CoordSource();
00047
00048 CoordSourcePtr Extract(int start=0, int stop=-1, int step=1);
00049
00050 virtual uint GetFrameCount()=0;
00051
00052 virtual CoordFramePtr GetFrame(uint frame_id) const = 0;
00053
00054 int GetAtomCount() const;
00055
00056 EntityHandle GetEntity() const;
00057
00058 const AtomHandleList& GetAtomList() const;
00059
00060 void SetAtomPos(uint frame, AtomHandle atom, const geom::Vec3& pos);
00061
00062 geom::Vec3 GetAtomPos(uint frame, AtomHandle atom) const;
00063
00065 void CopyFrame(uint frame);
00066 bool IsMutable() const;
00067
00068 void Capture();
00069 void CaptureInto(int pos);
00070 void Capture(uint f);
00071
00072 virtual void AddFrame(const std::vector<geom::Vec3>& coords) = 0;
00073 virtual void InsertFrame(int pos, const std::vector<geom::Vec3>& coords) = 0;
00074 protected:
00075 void SetMutable(bool flag);
00076 private:
00077 AtomHandleList atoms_;
00078 EntityHandle entity_;
00079 bool mutable_;
00080 std::map<long,uint> atom_dict_;
00081 };
00082
00083 }}
00084
00085 #endif