Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/PdbAtomInfoContainer.cpp

    r16462f r4fbca9c  
    2424#include "Helpers/toString.hpp"
    2525//#include "Helpers/Verbose.hpp"
    26 #include "LinearAlgebra/Vector.hpp"
    2726#include "PdbAtomInfoContainer.hpp"
    2827
    2928
    3029PdbAtomInfoContainer::PdbAtomInfoContainer() :
    31   token("ATOM"),
    3230  serial(0),
    3331  name("-"),
    34   altLoc('0'),
     32  altloc('0'),
    3533  resName("-"),
    3634  chainID('0'),
     
    3937  occupancy(0.),
    4038  tempFactor(0.),
    41   element(""),
    4239  charge(0)
    4340{}
     
    4946{
    5047  switch (key) {
    51     case PdbKey::token :
    52       ScanKey(token, value);
    53       break;
    5448    case PdbKey::serial :
    5549      ScanKey(serial, value);
     
    5852      ScanKey(name, value);
    5953      break;
    60     case PdbKey::altLoc :
    61       ScanKey(altLoc, value);
     54    case PdbKey::altloc :
     55      ScanKey(altloc, value);
    6256      break;
    6357    case PdbKey::resName :
     
    7367      ScanKey(iCode, value);
    7468      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;
    8469    case PdbKey::occupancy :
    8570      ScanKey(occupancy, value);
     
    8772    case PdbKey::tempFactor :
    8873      ScanKey(tempFactor, value);
    89       break;
    90     case PdbKey::element :
    91       ScanKey(element, value);
    9274      break;
    9375    case PdbKey::charge :
     
    10082}
    10183
    102 template <>
    103 std::string PdbAtomInfoContainer::get<std::string>(const PdbKey::PdbDataKey key) const
     84std::string PdbAtomInfoContainer::get(const PdbKey::PdbDataKey key) const
    10485{
    10586  switch (key) {
    106     case PdbKey::token :
    107       return toString(token);
    10887    case PdbKey::serial :
    10988      return toString(serial);
    11089    case PdbKey::name :
    11190      return toString(name);
    112     case PdbKey::altLoc :
    113       return toString(altLoc);
     91    case PdbKey::altloc :
     92      return toString(altloc);
    11493    case PdbKey::resName :
    11594      return toString(resName);
     
    12099    case PdbKey::iCode :
    121100      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]);
    128101    case PdbKey::occupancy :
    129102      return toString(occupancy);
    130103    case PdbKey::tempFactor :
    131104      return toString(tempFactor);
    132     case PdbKey::element :
    133       return toString(element);
    134105    case PdbKey::charge :
    135106      return toString(charge);
     
    140111}
    141112
    142 template <>
    143 int PdbAtomInfoContainer::get<int>(const PdbKey::PdbDataKey key) const
    144 {
    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) const
    160 {
    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.