Biotype.h
Go to the documentation of this file.00001 #ifndef SimTK_MOLMODEL_BIOTYPE_H_
00002 #define SimTK_MOLMODEL_BIOTYPE_H_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #include "molmodel/internal/common.h"
00037 #include "molmodel/internal/Element.h"
00038 #include "molmodel/internal/GrinPointer.h"
00039
00040 namespace SimTK {
00041
00042 namespace Ordinality {
00044 enum Residue {
00045 Any = 1,
00046 Initial = 2,
00047 Final = 3};
00048 }
00049
00050
00051
00052 SimTK_DEFINE_AND_EXPORT_UNIQUE_INDEX_TYPE(SimTK_MOLMODEL_EXPORT,BiotypeIndex);
00053 SimTK_DEFINE_AND_EXPORT_UNIQUE_INDEX_TYPE(SimTK_MOLMODEL_EXPORT,TinkerBiotypeIndex);
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063 class SimTK_MOLMODEL_EXPORT Biotype
00064 {
00065 public:
00066
00067
00068 static const Biotype& Argon();
00069
00070 static const Biotype& MethaneH();
00071 static const Biotype& MethaneC();
00072
00073 static const Biotype& EthaneH();
00074 static const Biotype& EthaneC();
00075
00076 static const Biotype& SerineN();
00077 static const Biotype& SerineHN();
00078 static const Biotype& SerineCA();
00079 static const Biotype& SerineHA();
00080
00081 static const Biotype& SerineC();
00082 static const Biotype& SerineO();
00083 static const Biotype& SerineCB();
00084 static const Biotype& SerineHB();
00085 static const Biotype& SerineOG();
00086 static const Biotype& SerineHG();
00087
00088 const Element& getElement() const;
00089 int getValence() const;
00090 BiotypeIndex getIndex() const;
00091 TinkerBiotypeIndex getTinkerBiotypeIfAny() const;
00092
00093 Biotype& setTinkerBiotypeIndex(TinkerBiotypeIndex tIx);
00094
00095 static void initializePopularBiotypes();
00096
00097 static const Biotype& get(BiotypeIndex biotypeIndex);
00098 static const Biotype& get(TinkerBiotypeIndex tinkerBiotypeIndex);
00099 static const Biotype& get(const char* residueName,
00100 const char* atomName,
00101 Ordinality::Residue ordinality = Ordinality::Any);
00102
00103 static Biotype& upd(BiotypeIndex biotypeIndex);
00104 static Biotype& upd(TinkerBiotypeIndex tinkerBiotypeIndex);
00105 static Biotype& upd(const char* residueName,
00106 const char* atomName,
00107 Ordinality::Residue ordinality = Ordinality::Any);
00108
00109 static bool exists(const char* residueName,
00110 const char* atomName,
00111 Ordinality::Residue ordinality = Ordinality::Any);
00112
00113 static bool exists(BiotypeIndex biotypeIndex);
00114
00115 static BiotypeIndex defineBiotype(const Element& element,
00116 int valence,
00117 const char* residueName,
00118 const char* atomName,
00119 Ordinality::Residue ordinality = Ordinality::Any)
00120 {
00121 return defineTinkerBiotype(InvalidTinkerBiotypeIndex,
00122 element,
00123 valence,
00124 residueName,
00125 atomName,
00126 ordinality);
00127 }
00128
00129 static BiotypeIndex defineTinkerBiotype(TinkerBiotypeIndex tinkerBiotypeIndex,
00130 const Element& element,
00131 int valence,
00132 const char* residueName,
00133 const char* atomName,
00134 Ordinality::Residue ordinality = Ordinality::Any);
00135
00136 static std::ostream& generateAllBiotypeCode(std::ostream& os);
00137
00138 Biotype();
00139
00140 const String& getAtomName() const;
00141 const String& getResidueName() const;
00142 Ordinality::Residue getOrdinality() const;
00143
00144
00145
00146
00147 std::ostream& generateSelfCode(std::ostream& os) const;
00148
00149 private:
00150
00151 Biotype( BiotypeIndex biotypeIndex,
00152 TinkerBiotypeIndex tinkerBiotypeIndex,
00153 const Element& element,
00154 int valence,
00155 const char* residueName,
00156 const char* atomName,
00157 Ordinality::Residue ordinality);
00158
00159
00160 #if defined(_MSC_VER)
00161 #pragma warning(push)
00162 #pragma warning(disable:4251)
00163 #endif
00164
00165 class Impl;
00166 GrinPointer<Impl> impl;
00167
00168 #if defined(_MSC_VER)
00169 #pragma warning(pop)
00170 #endif
00171
00172 };
00173
00174 }
00175
00176 #endif // SimTK_MOLMODEL_BIOTYPE_H_