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_RULE_BASED_BUILDER_HH 00020 #define OST_CONOP_RULE_BASED_BUILDER_HH 00021 00022 /* 00023 Author: Marco Biasini 00024 */ 00025 #include <set> 00026 #include <map> 00027 00028 #include "builder.hh" 00029 #include "compound_lib.hh" 00030 00031 namespace ost { namespace conop { 00032 00040 class DLLEXPORT_OST_CONOP RuleBasedBuilder: public Builder { 00041 public: 00042 RuleBasedBuilder(const CompoundLibPtr& compound_lib) 00043 : compound_lib_(compound_lib), last_compound_() { 00044 } 00045 00047 virtual void FillAtomProps(mol::AtomHandle atom); 00048 00049 virtual void CompleteAtoms(const mol::ResidueHandle& rh); 00050 00061 virtual void CheckResidueCompleteness(const mol::ResidueHandle& rh); 00062 00068 virtual mol::ResidueKey IdentifyResidue(const mol::ResidueHandle& rh); 00069 00070 00071 virtual void ConnectAtomsOfResidue(const mol::ResidueHandle& rh); 00072 00082 virtual void ConnectResidueToNext(const mol::ResidueHandle& rh, 00083 const mol::ResidueHandle& next); 00085 virtual void AssignTorsions(const mol::ChainHandle& ch); 00086 virtual void AssignTorsionsToResidue(const mol::ResidueHandle& residue); 00096 virtual bool OnUnknownAtom(mol::AtomHandle atom); 00097 00102 virtual void OnMissingAtom(const mol::ResidueHandle& residue, 00103 const String& atom_name) { } 00104 00106 virtual void FillAtomProps(mol::AtomHandle atom, const AtomSpec& spec); 00107 00109 virtual void FillResidueProps(mol::ResidueHandle residue); 00110 00111 00112 00115 virtual bool IsResidueComplete(const mol::ResidueHandle& residue); 00116 private: 00117 CompoundLibPtr compound_lib_; 00118 CompoundPtr last_compound_; 00119 void LookupCompound(const mol::ResidueHandle& rh); 00121 void ReorderAtoms(const mol::ResidueHandle& residue, CompoundPtr compound); 00122 00123 mol::AtomHandle LocateAtom(const mol::AtomHandleList& ahl, int ordinal); 00124 00125 void AssignBackBoneTorsionsToResidue(const mol::ResidueHandle& residue); 00126 00127 00128 }; 00129 00130 00131 00132 }} 00133 00134 #endif 00135
1.5.8