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_ATOM_BASE_HH 00020 #define OST_ATOM_BASE_HH 00021 00022 #include <ost/mol/module_config.hh> 00023 #include <ost/geom/vec3.hh> 00024 #include <ost/mol/impl/atom_impl_fw.hh> 00025 #include <ost/generic_property.hh> 00026 00027 #include "property_id.hh" 00028 00029 namespace ost { namespace mol { 00030 00047 class DLLEXPORT_OST_MOL AtomBase: public GenericPropContainer<AtomBase> { 00048 public: 00049 AtomBase(); 00050 AtomBase(const impl::AtomImplPtr& impl); 00051 public: 00052 friend class ConstGenericPropContainer<AtomBase>; 00056 const String& GetName() const; 00057 00067 void SetName(const String& atom_name); 00068 00070 const geom::Vec3& GetPos() const; 00071 00073 const geom::Vec3& GetOriginalPos() const; 00075 geom::Vec3 GetAltPos(const String& alt_group) const; 00076 00077 std::vector<String> GetAltGroupNames() const; 00079 00080 00081 00082 00083 00084 const AtomProp& GetAtomProps() const; 00085 00087 void SetAtomProps(const AtomProp& prop); 00089 00091 00092 00093 00094 00095 00096 00097 00098 operator bool() const; 00101 bool IsValid() const; 00103 00109 String GetQualifiedName() const; 00110 00112 String GetStringProperty(Prop::ID prop_id) const; 00113 00115 Real GetFloatProperty(Prop::ID prop_id) const; 00116 00118 int GetIntProperty(Prop::ID prop_id) const; 00119 00121 unsigned long GetIndex() const; 00122 00124 Real GetRadius() const; 00125 00127 const String& GetElement() const; 00128 00130 bool IsHetAtom() const; 00131 00135 Real GetBFactor() const; 00136 00140 Real GetMass() const; 00141 00143 Real GetCharge() const; 00144 00146 Real GetOccupancy() const; 00147 00151 const impl::AtomImplPtr& Impl() const; 00152 00154 impl::AtomImplPtr& Impl(); 00155 00156 protected: 00157 00158 GenericPropContainerImpl* GpImpl(); 00159 00160 const GenericPropContainerImpl* GpImpl() const; 00161 00162 void CheckValidity() const; 00163 impl::AtomImplPtr impl_; 00164 }; 00165 00166 DLLEXPORT_OST_MOL std::ostream& operator<<(std::ostream& os, 00167 const AtomBase& atom); 00168 }} // ns 00169 00170 #endif // OST_ATOM_BASE_HH 00171
1.5.8