- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/PdbAtomInfoContainer.cpp
r16462f r4fbca9c 24 24 #include "Helpers/toString.hpp" 25 25 //#include "Helpers/Verbose.hpp" 26 #include "LinearAlgebra/Vector.hpp"27 26 #include "PdbAtomInfoContainer.hpp" 28 27 29 28 30 29 PdbAtomInfoContainer::PdbAtomInfoContainer() : 31 token("ATOM"),32 30 serial(0), 33 31 name("-"), 34 alt Loc('0'),32 altloc('0'), 35 33 resName("-"), 36 34 chainID('0'), … … 39 37 occupancy(0.), 40 38 tempFactor(0.), 41 element(""),42 39 charge(0) 43 40 {} … … 49 46 { 50 47 switch (key) { 51 case PdbKey::token :52 ScanKey(token, value);53 break;54 48 case PdbKey::serial : 55 49 ScanKey(serial, value); … … 58 52 ScanKey(name, value); 59 53 break; 60 case PdbKey::alt Loc :61 ScanKey(alt Loc, value);54 case PdbKey::altloc : 55 ScanKey(altloc, value); 62 56 break; 63 57 case PdbKey::resName : … … 73 67 ScanKey(iCode, value); 74 68 break; 75 case PdbKey::X :76 ScanKey(XYZ[0], value);77 break;78 case PdbKey::Y :79 ScanKey(XYZ[1], value);80 break;81 case PdbKey::Z :82 ScanKey(XYZ[2], value);83 break;84 69 case PdbKey::occupancy : 85 70 ScanKey(occupancy, value); … … 87 72 case PdbKey::tempFactor : 88 73 ScanKey(tempFactor, value); 89 break;90 case PdbKey::element :91 ScanKey(element, value);92 74 break; 93 75 case PdbKey::charge : … … 100 82 } 101 83 102 template <> 103 std::string PdbAtomInfoContainer::get<std::string>(const PdbKey::PdbDataKey key) const 84 std::string PdbAtomInfoContainer::get(const PdbKey::PdbDataKey key) const 104 85 { 105 86 switch (key) { 106 case PdbKey::token :107 return toString(token);108 87 case PdbKey::serial : 109 88 return toString(serial); 110 89 case PdbKey::name : 111 90 return toString(name); 112 case PdbKey::alt Loc :113 return toString(alt Loc);91 case PdbKey::altloc : 92 return toString(altloc); 114 93 case PdbKey::resName : 115 94 return toString(resName); … … 120 99 case PdbKey::iCode : 121 100 return toString(iCode); 122 case PdbKey::X :123 return toString(XYZ[0]);124 case PdbKey::Y :125 return toString(XYZ[1]);126 case PdbKey::Z :127 return toString(XYZ[2]);128 101 case PdbKey::occupancy : 129 102 return toString(occupancy); 130 103 case PdbKey::tempFactor : 131 104 return toString(tempFactor); 132 case PdbKey::element :133 return toString(element);134 105 case PdbKey::charge : 135 106 return toString(charge); … … 140 111 } 141 112 142 template <>143 int PdbAtomInfoContainer::get<int>(const PdbKey::PdbDataKey key) const144 {145 switch (key) {146 case PdbKey::serial :147 return serial;148 case PdbKey::resSeq :149 return resSeq;150 case PdbKey::charge :151 return charge;152 default :153 std::cout << "Unknown key or not presentable as int: " << key << std::endl;154 return 0;155 }156 }157 158 template <>159 double PdbAtomInfoContainer::get<double>(const PdbKey::PdbDataKey key) const160 {161 switch (key) {162 case PdbKey::X :163 return XYZ[0];164 case PdbKey::Y :165 return XYZ[1];166 case PdbKey::Z :167 return XYZ[2];168 case PdbKey::occupancy :169 return occupancy;170 case PdbKey::tempFactor :171 return tempFactor;172 default :173 std::cout << "Unknown key or not presentable as double: " << key << std::endl;174 return 0.;175 }176 }
Note:
See TracChangeset
for help on using the changeset viewer.