[031e2c6] | 1 | /*
|
---|
| 2 | * Project: MoleCuilder
|
---|
| 3 | * Description: creates and alters molecular systems
|
---|
[0aa122] | 4 | * Copyright (C) 2010-2012 University of Bonn. All rights reserved.
|
---|
[031e2c6] | 5 | * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | /*
|
---|
| 9 | * TremoloAtomInfoContainer.cpp
|
---|
| 10 | *
|
---|
| 11 | * Created on: Dec 7, 2010
|
---|
| 12 | * Author: heber
|
---|
| 13 | */
|
---|
| 14 |
|
---|
[dd97a9] | 15 | // include config.h
|
---|
| 16 | #ifdef HAVE_CONFIG_H
|
---|
| 17 | #include <config.h>
|
---|
| 18 | #endif
|
---|
| 19 |
|
---|
[ad011c] | 20 | #include "CodePatterns/MemDebug.hpp"
|
---|
[031e2c6] | 21 |
|
---|
[4d4d33] | 22 | #include "CodePatterns/toString.hpp"
|
---|
| 23 |
|
---|
[031e2c6] | 24 | #include <iostream>
|
---|
| 25 |
|
---|
[dd97a9] | 26 | #include "TremoloAtomInfoContainer.hpp"
|
---|
| 27 |
|
---|
[031e2c6] | 28 |
|
---|
| 29 | TremoloAtomInfoContainer::TremoloAtomInfoContainer() :
|
---|
| 30 | F("0"),
|
---|
| 31 | stress("0"),
|
---|
| 32 | imprData("-"),
|
---|
| 33 | GroupMeasureTypeNo("0"),
|
---|
[305e7e] | 34 | type("-"),
|
---|
[031e2c6] | 35 | extType("-"),
|
---|
| 36 | name("-"),
|
---|
| 37 | resName("-"),
|
---|
| 38 | chainID("0"),
|
---|
| 39 | resSeq("0"),
|
---|
| 40 | occupancy("0"),
|
---|
| 41 | tempFactor("0"),
|
---|
| 42 | segID("0"),
|
---|
| 43 | Charge("0"),
|
---|
| 44 | charge("0"),
|
---|
| 45 | GrpTypeNo("0"),
|
---|
| 46 | torsion("-"),
|
---|
[0bbfa1] | 47 | neighbors(std::vector<int>(0, 5)),
|
---|
| 48 | neighbors_processed(false)
|
---|
[031e2c6] | 49 | {}
|
---|
| 50 |
|
---|
| 51 | void TremoloAtomInfoContainer::set(TremoloKey::atomDataKey key, std::string value) {
|
---|
| 52 | switch (key) {
|
---|
| 53 | case TremoloKey::F :
|
---|
| 54 | F = value;
|
---|
| 55 | break;
|
---|
| 56 | case TremoloKey::stress :
|
---|
| 57 | stress = value;
|
---|
| 58 | break;
|
---|
| 59 | case TremoloKey::imprData :
|
---|
| 60 | imprData = value;
|
---|
| 61 | break;
|
---|
| 62 | case TremoloKey::GroupMeasureTypeNo :
|
---|
| 63 | GroupMeasureTypeNo = value;
|
---|
| 64 | break;
|
---|
[305e7e] | 65 | case TremoloKey::type :
|
---|
| 66 | type = value;
|
---|
[4d4d33] | 67 | break;
|
---|
[031e2c6] | 68 | case TremoloKey::extType :
|
---|
| 69 | extType = value;
|
---|
| 70 | break;
|
---|
| 71 | case TremoloKey::name :
|
---|
| 72 | name = value;
|
---|
| 73 | break;
|
---|
| 74 | case TremoloKey::resName :
|
---|
| 75 | resName = value;
|
---|
| 76 | break;
|
---|
| 77 | case TremoloKey::chainID :
|
---|
| 78 | chainID = value;
|
---|
| 79 | break;
|
---|
| 80 | case TremoloKey::resSeq :
|
---|
| 81 | resSeq = value;
|
---|
| 82 | break;
|
---|
| 83 | case TremoloKey::occupancy :
|
---|
| 84 | occupancy = value;
|
---|
| 85 | break;
|
---|
| 86 | case TremoloKey::tempFactor :
|
---|
| 87 | tempFactor = value;
|
---|
| 88 | break;
|
---|
| 89 | case TremoloKey::segID :
|
---|
| 90 | segID = value;
|
---|
| 91 | break;
|
---|
| 92 | case TremoloKey::Charge :
|
---|
| 93 | Charge = value;
|
---|
| 94 | break;
|
---|
| 95 | case TremoloKey::charge :
|
---|
| 96 | charge = value;
|
---|
| 97 | break;
|
---|
| 98 | case TremoloKey::GrpTypeNo :
|
---|
| 99 | GrpTypeNo = value;
|
---|
| 100 | break;
|
---|
| 101 | case TremoloKey::torsion :
|
---|
| 102 | torsion = value;
|
---|
| 103 | break;
|
---|
[ff3c40] | 104 | case TremoloKey::noKey :
|
---|
| 105 | break;
|
---|
[031e2c6] | 106 | default :
|
---|
| 107 | std::cout << "Unknown key: " << key << ", value: " << value << std::endl;
|
---|
| 108 | break;
|
---|
| 109 | }
|
---|
| 110 | }
|
---|
| 111 |
|
---|
[4d4d33] | 112 | std::string TremoloAtomInfoContainer::get(TremoloKey::atomDataKey key) const
|
---|
| 113 | {
|
---|
[031e2c6] | 114 | switch (key) {
|
---|
| 115 | case TremoloKey::F :
|
---|
| 116 | return F;
|
---|
| 117 | case TremoloKey::stress :
|
---|
| 118 | return stress;
|
---|
| 119 | case TremoloKey::imprData :
|
---|
| 120 | return imprData;
|
---|
| 121 | case TremoloKey::GroupMeasureTypeNo :
|
---|
| 122 | return GroupMeasureTypeNo;
|
---|
[305e7e] | 123 | case TremoloKey::type :
|
---|
| 124 | return type;
|
---|
[031e2c6] | 125 | case TremoloKey::extType :
|
---|
| 126 | return extType;
|
---|
| 127 | case TremoloKey::name :
|
---|
| 128 | return name;
|
---|
| 129 | case TremoloKey::resName :
|
---|
| 130 | return resName;
|
---|
| 131 | case TremoloKey::chainID :
|
---|
| 132 | return chainID;
|
---|
| 133 | case TremoloKey::resSeq :
|
---|
| 134 | return resSeq;
|
---|
| 135 | case TremoloKey::occupancy :
|
---|
| 136 | return occupancy;
|
---|
| 137 | case TremoloKey::tempFactor :
|
---|
| 138 | return tempFactor;
|
---|
| 139 | case TremoloKey::segID :
|
---|
| 140 | return segID;
|
---|
| 141 | case TremoloKey::Charge :
|
---|
| 142 | return Charge;
|
---|
| 143 | case TremoloKey::charge :
|
---|
| 144 | return charge;
|
---|
| 145 | case TremoloKey::GrpTypeNo :
|
---|
| 146 | return GrpTypeNo;
|
---|
| 147 | case TremoloKey::torsion :
|
---|
| 148 | return torsion;
|
---|
[ff3c40] | 149 | case TremoloKey::noKey :
|
---|
| 150 | return std::string("noKey"); // warning string
|
---|
[031e2c6] | 151 | default :
|
---|
| 152 | std::cout << "Unknown key: " << key << std::endl;
|
---|
| 153 | return "";
|
---|
| 154 | }
|
---|
| 155 | }
|
---|
| 156 |
|
---|
[4d4d33] | 157 | std::ostream& operator<<(std::ostream& out, const TremoloAtomInfoContainer& info)
|
---|
| 158 | {
|
---|
| 159 | out << info.get(TremoloKey::F) << "\t";
|
---|
| 160 | out << info.get(TremoloKey::stress) << "\t";
|
---|
| 161 | out << info.get(TremoloKey::imprData) << "\t";
|
---|
| 162 | out << info.get(TremoloKey::GroupMeasureTypeNo) << "\t";
|
---|
[305e7e] | 163 | out << info.get(TremoloKey::type) << "\t";
|
---|
[4d4d33] | 164 | out << info.get(TremoloKey::extType) << "\t";
|
---|
| 165 | out << info.get(TremoloKey::name) << "\t";
|
---|
| 166 | out << info.get(TremoloKey::resName) << "\t";
|
---|
| 167 | out << info.get(TremoloKey::chainID) << "\t";
|
---|
| 168 | out << info.get(TremoloKey::resSeq) << "\t";
|
---|
| 169 | out << info.get(TremoloKey::occupancy) << "\t";
|
---|
| 170 | out << info.get(TremoloKey::tempFactor) << "\t";
|
---|
| 171 | out << info.get(TremoloKey::segID) << "\t";
|
---|
| 172 | out << info.get(TremoloKey::Charge) << "\t";
|
---|
| 173 | out << info.get(TremoloKey::charge) << "\t";
|
---|
| 174 | out << info.get(TremoloKey::GrpTypeNo) << "\t";
|
---|
| 175 | out << info.get(TremoloKey::torsion) << "\t";
|
---|
| 176 | out << info.neighbors << "\t";
|
---|
| 177 | out << info.neighbors_processed;
|
---|
| 178 |
|
---|
| 179 | return out;
|
---|
| 180 | }
|
---|