00001 //------------------------------------------------------------------------------ 00002 // This file is part of the OpenStructure project <www.openstructure.org> 00003 // 00004 // Copyright (C) 2008-2010 by the OpenStructure authors 00005 // 00006 // This library is free software; you can redistribute it and/or modify it under 00007 // the terms of the GNU Lesser General Public License as published by the Free 00008 // Software Foundation; either version 3.0 of the License, or (at your option) 00009 // any later version. 00010 // This library is distributed in the hope that it will be useful, but WITHOUT 00011 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00012 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00013 // details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public License 00016 // along with this library; if not, write to the Free Software Foundation, Inc., 00017 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00018 //------------------------------------------------------------------------------ 00019 #ifndef OST_COORD_GROUP_HH 00020 #define OST_COORD_GROUP_HH 00021 00022 /* 00023 Author: Ansgar Philippsen, Marco Biasini 00024 */ 00025 00026 #include <vector> 00027 #include <boost/shared_array.hpp> 00028 00029 #include "atom_handle.hh" 00030 #include "coord_source.hh" 00031 00032 namespace ost { namespace mol { 00033 00035 class DLLEXPORT_OST_MOL CoordGroupHandle { 00036 friend DLLEXPORT_OST_MOL 00037 CoordGroupHandle CreateCoordGroup(const std::vector<AtomHandle>&); 00038 00039 public: 00041 CoordGroupHandle(); 00042 00044 EntityHandle GetEntity() const; 00045 00046 //EntityGroupHandle ExtractFromTo(int start, int end, int step=1); 00047 //EntityGroupHandle ExtractEvery(int step, int start=0); 00048 00050 uint GetAtomCount() const; 00051 00053 uint GetFrameCount() const; 00054 00057 void SetFramePositions(uint frame, const std::vector<geom::Vec3>& clist); 00058 00060 void CopyFrame(uint frame); 00061 00063 void Capture(); 00064 00065 void CaptureInto(int pos); 00066 00068 void Capture(uint frame); 00069 00071 void AddFrame(const std::vector<geom::Vec3>& clist); 00072 00074 void SetAtomPos(uint frame, AtomHandle atom, const geom::Vec3& pos); 00075 00077 geom::Vec3 GetAtomPos(uint frame, AtomHandle atom) const; 00078 00080 bool IsValid() const; 00081 00083 operator bool() const; 00084 00085 AtomHandleList GetAtomList() const; 00086 CoordFramePtr GetFrame(uint frame) const; 00087 private: 00088 void CheckValidity() const; 00089 00090 CoordGroupHandle(CoordSourcePtr source); 00091 00092 CoordSourcePtr source_; 00093 }; 00094 00095 // factory method 00096 // create with a reference set of atoms and zero frames 00097 DLLEXPORT_OST_MOL CoordGroupHandle CreateCoordGroup(const AtomHandleList& atoms); 00098 00099 }} // ns 00100 00101 #endif
1.5.8