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_CONOP_HH 00020 #define OST_CONOP_HH 00021 00022 #include <map> 00023 #include <ost/conop/module_config.hh> 00024 #include <ost/mol/entity_handle.hh> 00025 #include "builder_fw.hh" 00026 00027 namespace ost { namespace conop { 00028 00029 class DLLEXPORT_OST_CONOP Conopology { 00030 typedef std::map<String,BuilderP> BuilderMap; 00031 00032 public: 00033 // singleton 00034 static Conopology& Instance(); 00035 00036 // retrieve a builder by name 00037 BuilderP GetBuilder(const String& name="DEFAULT"); 00038 00039 // return default vdW radius 00040 // temporary location until more elaborate chemical information is impl 00041 Real GetDefaultAtomRadius(const String& element) const; 00042 00043 // return default mass 00044 Real GetDefaultAtomMass(const String& element) const; 00045 00046 /* 00047 convenience function, connect all atoms with given coordinates, 00048 such as after coordinate file import, based on a given builder 00049 00050 does this need to live within Conopology ? 00051 */ 00052 void ConnectAll(const BuilderP& b, mol::EntityHandle eh, int flag=0); 00053 00054 void RegisterBuilder(const BuilderP& b, const String& name); 00055 void SetDefaultBuilder(const String& default_name); 00056 private: 00057 Conopology(); 00058 Conopology(const Conopology&) {} 00059 Conopology& operator=(const Conopology&) {return *this;} 00060 00061 BuilderMap builder_map_; 00062 std::map<String,Real> ele_rad_map_; 00063 std::map<String,Real> ele_mass_map_; 00064 }; 00065 00066 }} // 00067 00068 #endif
1.5.8