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_RESIDUE_VIEW_HH 00020 #define OST_RESIDUE_VIEW_HH 00021 00022 #include <ost/mol/query.hh> 00023 #include <ost/mol/module_config.hh> 00024 #include <ost/geom/geom.hh> 00025 #include <ost/mol/residue_base.hh> 00026 #include <ost/mol/view_type_fw.hh> 00027 #include <ost/mol/impl/residue_impl_fw.hh> 00028 #include <ost/mol/entity_visitor_fw.hh> 00029 #include <ost/mol/handle_type_fw.hh> 00030 00031 namespace ost { namespace mol { 00032 00039 class DLLEXPORT_OST_MOL ResidueView : public ResidueBase { 00040 00041 friend class ChainView; 00042 00043 public: 00045 ResidueView(); 00046 00052 ResidueView(const ChainView& chain, 00053 const ResidueHandle& residue); 00054 00055 public: 00057 00058 00059 00060 00061 ResidueView(const ResidueViewDataPtr& data, 00062 const impl::ResidueImplPtr& impl); 00063 00065 const ResidueViewDataPtr& ViewData() const { 00066 return data_; 00067 } 00069 ResidueViewDataPtr& ViewData() { 00070 return data_; 00071 } 00073 public: 00075 00076 00077 00078 00079 00080 00081 00082 00083 00084 00085 00086 AtomView AddAtom(const AtomView& atom_view, 00087 ViewAddFlags flags=0); 00088 00098 AtomView AddAtom(const AtomHandle& atom_handle, 00099 ViewAddFlags flags=0); 00101 00103 AtomView FindAtom(const String& atom_name) const; 00104 00106 AtomView FindAtom(const AtomHandle& handle) const; 00107 00109 bool IsAtomIncluded(const AtomHandle& handle) const; 00110 00114 void RemoveAtom(AtomView view); 00115 00120 void RemoveAtoms(); 00121 00123 void Apply(EntityVisitor& visitor); 00124 void Apply(EntityViewVisitor& visitor); 00125 00127 int GetAtomCount() const; 00128 00130 const AtomViewList& GetAtomList() const; 00131 00133 ResidueHandle GetHandle() const; 00134 00136 EntityView GetEntity() const; 00137 00139 int GetIndex() const; 00141 ChainView GetChain() const; 00142 00143 00145 double GetMass() const; 00146 00148 geom::Vec3 GetCenterOfMass() const; 00149 00154 geom::Vec3 GetCenterOfAtoms() const; 00155 00160 geom::Vec3 GetGeometricCenter() const; 00161 00162 geom::Vec3 GetGeometricStart() const; 00163 geom::Vec3 GetGeometricEnd() const; 00164 00167 EntityView Select(const Query& q, QueryFlags flags=0) const; 00168 00171 EntityView Select(const String& query_string, QueryFlags flags=0) const; 00172 00173 bool operator==(const ResidueView& rhs) const; 00174 00175 bool operator!=(const ResidueView& rhs) const; 00176 00177 protected: 00180 void SetIndex(int index); 00181 00182 private: 00183 ResidueViewDataPtr data_; 00184 }; 00185 00186 }} // ns 00187 00188 #endif // OST_RESIDUE_VIEW_HH 00189
1.5.8