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_RESIDUE_HANDLE_HU 00020 #define OST_RESIDUE_HANDLE_HU 00021 00022 #include <ost/geom/vec3.hh> 00023 #include <ost/geom/aligned_cuboid.hh> 00024 00025 #include <ost/mol/query.hh> 00026 #include <ost/mol/module_config.hh> 00027 #include <ost/mol/residue_base.hh> 00028 #include <ost/mol/entity_visitor_fw.hh> 00029 00030 namespace ost { namespace mol { 00031 00054 class DLLEXPORT_OST_MOL ResidueHandle : public ResidueBase { 00055 public: 00056 ResidueHandle(); 00057 00059 ResidueHandle(const impl::ResidueImplPtr& impl) 00060 : ResidueBase(impl) {} 00061 EntityHandle GetEntity() const; 00062 00064 double GetMass() const; 00065 00067 geom::Vec3 GetCenterOfMass() const; 00068 00073 geom::Vec3 GetCenterOfAtoms() const; 00074 00076 geom::AlignedCuboid GetBounds() const; 00077 00079 ChainHandle GetChain() const; 00080 00083 ResidueHandle GetPrev() const; 00084 00087 ResidueHandle GetNext() const; 00088 00092 AtomHandle FindAtom(const String& aname) const; 00093 00098 void Apply(EntityVisitor& visitor); 00099 00103 AtomHandleList GetAtomList() const; 00104 00106 int GetAtomCount() const; 00107 00113 int GetBondCount() const; 00114 00124 TorsionHandle FindTorsion(const String& torsion_name) const; 00125 00127 TorsionHandleList GetTorsionList() const; 00128 00130 int GetIndex() const; 00131 00138 00139 00140 00141 bool HasAltAtomGroup(const String& group) const; 00142 00147 const String& GetCurrentAltGroupName() const; 00148 00150 std::vector<String> GetAltAtomGroupNames() const; 00151 00153 bool HasAltAtoms() const; 00154 00158 geom::Vec3 GetAltAtomPos(const AtomHandle& atom, const String& group) const; 00159 00166 bool SwitchAtomPos(const String& group); 00168 00172 ResidueHandle GetHandle() const; 00173 unsigned long GetHashCode() const; 00174 00177 EntityView Select(const Query& q, QueryFlags flags=0) const; 00178 00181 EntityView Select(const String& query_string, QueryFlags flags=0) const; 00182 00183 bool operator==(const ResidueHandle& ref) const; 00184 bool operator!=(const ResidueHandle& ref) const; 00185 00186 00187 00188 }; 00189 00194 bool DLLEXPORT_OST_MOL InSequence(const ResidueHandle& residue_one, 00195 const ResidueHandle& residue_two); 00196 00197 00198 }} //ns 00199 00200 #endif // OST_RESIDUE_HANDLE_HH 00201