00001 //------------------------------------------------------------------------------ 00002 // This file is part of the OpenStructure project <www.openstructure.org> 00003 // 00004 // Copyright (C) 2008-2011 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_CHAIN_HANDLE_HS 00020 #define OST_CHAIN_HANDLE_HS 00021 00022 #include <vector> 00023 00024 #include <ost/mol/module_config.hh> 00025 00026 #include <ost/geom/geom.hh> 00027 00028 #include "chain_base.hh" 00029 00030 #include "query.hh" 00031 #include "view_type_fw.hh" 00032 #include "handle_type_fw.hh" 00033 #include "residue_prop.hh" 00034 #include "entity_visitor_fw.hh" 00035 #include "sec_structure.hh" 00036 00037 namespace ost { namespace mol { 00038 00052 class DLLEXPORT_OST_MOL ChainHandle : public ChainBase { 00053 00054 public: 00055 ChainHandle(); 00056 00057 ChainHandle(const impl::ChainImplPtr& impl); 00058 00059 00061 EntityHandle GetEntity() const; 00062 00066 void Apply(EntityVisitor& visitor); 00067 00069 00074 ResidueHandle GetPrev(const ResidueHandle& rh); 00075 ResidueHandle GetNext(const ResidueHandle& rh); 00076 00078 00079 00080 00081 00082 00083 ResidueHandle FindResidue(const ResNum& num) const; 00084 00092 AtomHandle FindAtom(const ResNum& num, 00093 const String& atom_name) const; 00097 ResidueHandle GetResidueByIndex(int index) const; 00099 00101 // 00102 // To count all atoms of the entity the chain belongs to, use 00103 // \c EntityHandle::GetAtomCount(). For count of specific residues, use 00104 // \c ResidueHandle::GetResidueCount(). 00105 int GetAtomCount() const; 00106 00113 int GetBondCount() const; 00114 00118 int GetResidueCount() const; 00119 00125 00126 00127 AtomHandleList GetAtomList() const; 00128 00134 ResidueHandleList GetResidueList() const; 00135 00137 Real GetMass() const; 00138 00140 geom::Vec3 GetCenterOfMass() const; 00141 00146 geom::Vec3 GetCenterOfAtoms() const; 00147 00148 geom::AlignedCuboid GetBounds() const; 00151 void AssignSecondaryStructure(SecStructure ss, 00152 const ResNum& start, 00153 const ResNum& end); 00154 00157 EntityView Select(const Query& q, QueryFlags flags=0) const; 00158 00161 EntityView Select(const String& query_string, QueryFlags flags=0) const; 00162 00166 ChainHandle GetHandle() const; 00169 bool InSequence() const; 00170 bool operator==(const ChainHandle& ref) const; 00171 bool operator!=(const ChainHandle& ref) const; 00172 00175 void SetInSequence(const int index); 00176 }; 00177 00178 }} // ns 00179 00180 #endif // OST_CHAIN_HANDLE_HH 00181