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_BASE_HH 00020 #define OST_RESIDUE_BASE_HH 00021 00022 #include <ost/geom/geom.hh> 00023 00024 #include <ost/mol/module_config.hh> 00025 #include <ost/mol/residue_prop.hh> 00026 #include <ost/mol/impl/residue_impl_fw.hh> 00027 #include <ost/mol/sec_structure.hh> 00028 #include <ost/mol/handle_type_fw.hh> 00029 #include <ost/mol/chem_class.hh> 00030 #include <ost/mol/chem_type.hh> 00031 00032 #include <ost/generic_property.hh> 00033 #include "property_id.hh" 00034 00035 namespace ost { namespace mol { 00036 00065 class DLLEXPORT_OST_MOL ResidueBase: 00066 public GenericPropContainer<ResidueBase> { 00067 public: 00068 ResidueBase(); 00069 ResidueBase(const impl::ResidueImplPtr& impl); 00070 ResidueBase(const ResidueBase& rhs); 00071 public: 00072 00074 00075 00076 00077 00078 00079 00080 00081 operator bool() const { return this->IsValid(); } 00084 bool IsValid() const { return Impl().get()!=0; } 00085 friend class ConstGenericPropContainer<ResidueBase>; 00087 const ResNum& GetNumber() const; 00088 00090 const ResidueKey& GetKey() const; 00091 00093 const String& GetName() const; 00094 00097 String GetQualifiedName() const; 00098 00100 AtomHandle GetCentralAtom() const; 00101 00109 void SetCentralAtom(const AtomHandle& a); 00110 00112 geom::Vec3 GetCentralNormal() const; 00113 00115 bool IsPeptideLinking() const; 00116 00118 bool IsNucleotideLinking() const; 00119 00120 ChemClass GetChemClass() const; 00121 00122 void SetChemClass(ChemClass cc); 00123 00125 ChemType GetChemType() const; 00126 00127 void SetChemType(ChemType ct); 00128 00131 SecStructure GetSecStructure() const; 00132 00136 void SetSecStructure(SecStructure ss); 00137 00142 TorsionHandle GetPhiTorsion() const; 00143 00148 TorsionHandle GetPsiTorsion() const; 00149 00154 TorsionHandle GetOmegaTorsion() const; 00155 char GetOneLetterCode() const; 00156 00157 void SetOneLetterCode(char olc); 00158 00160 String GetStringProperty(Prop::ID prop_id) const; 00161 00163 Real GetFloatProperty(Prop::ID prop_id) const; 00164 00166 int GetIntProperty(Prop::ID prop_id) const; 00167 00169 bool IsProtein() const; 00170 00171 void SetIsProtein(bool protein); 00172 00173 void SetIsLigand(bool ligand); 00174 00175 bool IsLigand() const; 00176 public: 00177 impl::ResidueImplPtr& Impl(); 00178 00179 const impl::ResidueImplPtr& Impl() const; 00180 protected: 00181 GenericPropContainerImpl* GpImpl(); 00182 00183 const GenericPropContainerImpl* GpImpl() const; 00184 void CheckValidity() const; 00185 private: 00186 impl::ResidueImplPtr impl_; 00187 00188 }; 00189 00190 DLLEXPORT_OST_MOL std::ostream& operator<<(std::ostream& os, 00191 const ResidueBase& residue); 00192 }} // ns 00193 00194 #endif // OST_RESIDUE_BASE_HH 00195