Changeset 16462f for src/Parser/PdbAtomInfoContainer.cpp
- Timestamp:
- Dec 16, 2010, 5:32:18 PM (14 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 1d02fe3
- Parents:
- 24f128
- git-author:
- Frederik Heber <heber@…> (12/07/10 12:54:42)
- git-committer:
- Frederik Heber <heber@…> (12/16/10 17:32:18)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Parser/PdbAtomInfoContainer.cpp
r24f128 r16462f 24 24 #include "Helpers/toString.hpp" 25 25 //#include "Helpers/Verbose.hpp" 26 #include "LinearAlgebra/Vector.hpp" 26 27 #include "PdbAtomInfoContainer.hpp" 27 28 28 29 29 30 PdbAtomInfoContainer::PdbAtomInfoContainer() : 31 token("ATOM"), 30 32 serial(0), 31 33 name("-"), 32 alt loc('0'),34 altLoc('0'), 33 35 resName("-"), 34 36 chainID('0'), … … 37 39 occupancy(0.), 38 40 tempFactor(0.), 41 element(""), 39 42 charge(0) 40 43 {} … … 46 49 { 47 50 switch (key) { 51 case PdbKey::token : 52 ScanKey(token, value); 53 break; 48 54 case PdbKey::serial : 49 55 ScanKey(serial, value); … … 52 58 ScanKey(name, value); 53 59 break; 54 case PdbKey::alt loc :55 ScanKey(alt loc, value);60 case PdbKey::altLoc : 61 ScanKey(altLoc, value); 56 62 break; 57 63 case PdbKey::resName : … … 67 73 ScanKey(iCode, value); 68 74 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; 69 84 case PdbKey::occupancy : 70 85 ScanKey(occupancy, value); … … 72 87 case PdbKey::tempFactor : 73 88 ScanKey(tempFactor, value); 89 break; 90 case PdbKey::element : 91 ScanKey(element, value); 74 92 break; 75 93 case PdbKey::charge : … … 82 100 } 83 101 84 std::string PdbAtomInfoContainer::get(const PdbKey::PdbDataKey key) const 102 template <> 103 std::string PdbAtomInfoContainer::get<std::string>(const PdbKey::PdbDataKey key) const 85 104 { 86 105 switch (key) { 106 case PdbKey::token : 107 return toString(token); 87 108 case PdbKey::serial : 88 109 return toString(serial); 89 110 case PdbKey::name : 90 111 return toString(name); 91 case PdbKey::alt loc :92 return toString(alt loc);112 case PdbKey::altLoc : 113 return toString(altLoc); 93 114 case PdbKey::resName : 94 115 return toString(resName); … … 99 120 case PdbKey::iCode : 100 121 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]); 101 128 case PdbKey::occupancy : 102 129 return toString(occupancy); 103 130 case PdbKey::tempFactor : 104 131 return toString(tempFactor); 132 case PdbKey::element : 133 return toString(element); 105 134 case PdbKey::charge : 106 135 return toString(charge); … … 111 140 } 112 141 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.