[031e2c6] | 1 | /*
|
---|
| 2 | * Project: MoleCuilder
|
---|
| 3 | * Description: creates and alters molecular systems
|
---|
[0aa122] | 4 | * Copyright (C) 2010-2012 University of Bonn. All rights reserved.
|
---|
[94d5ac6] | 5 | *
|
---|
| 6 | *
|
---|
| 7 | * This file is part of MoleCuilder.
|
---|
| 8 | *
|
---|
| 9 | * MoleCuilder is free software: you can redistribute it and/or modify
|
---|
| 10 | * it under the terms of the GNU General Public License as published by
|
---|
| 11 | * the Free Software Foundation, either version 2 of the License, or
|
---|
| 12 | * (at your option) any later version.
|
---|
| 13 | *
|
---|
| 14 | * MoleCuilder is distributed in the hope that it will be useful,
|
---|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 17 | * GNU General Public License for more details.
|
---|
| 18 | *
|
---|
| 19 | * You should have received a copy of the GNU General Public License
|
---|
| 20 | * along with MoleCuilder. If not, see <http://www.gnu.org/licenses/>.
|
---|
[031e2c6] | 21 | */
|
---|
| 22 |
|
---|
| 23 | /*
|
---|
| 24 | * TremoloAtomInfoContainer.cpp
|
---|
| 25 | *
|
---|
| 26 | * Created on: Dec 7, 2010
|
---|
| 27 | * Author: heber
|
---|
| 28 | */
|
---|
| 29 |
|
---|
[dd97a9] | 30 | // include config.h
|
---|
| 31 | #ifdef HAVE_CONFIG_H
|
---|
| 32 | #include <config.h>
|
---|
| 33 | #endif
|
---|
| 34 |
|
---|
[ad011c] | 35 | #include "CodePatterns/MemDebug.hpp"
|
---|
[031e2c6] | 36 |
|
---|
[4d4d33] | 37 | #include "CodePatterns/toString.hpp"
|
---|
| 38 |
|
---|
[031e2c6] | 39 | #include <iostream>
|
---|
| 40 |
|
---|
[dd97a9] | 41 | #include "TremoloAtomInfoContainer.hpp"
|
---|
| 42 |
|
---|
[031e2c6] | 43 |
|
---|
| 44 | TremoloAtomInfoContainer::TremoloAtomInfoContainer() :
|
---|
| 45 | F("0"),
|
---|
| 46 | stress("0"),
|
---|
| 47 | imprData("-"),
|
---|
| 48 | GroupMeasureTypeNo("0"),
|
---|
[305e7e] | 49 | type("-"),
|
---|
[031e2c6] | 50 | extType("-"),
|
---|
| 51 | name("-"),
|
---|
| 52 | resName("-"),
|
---|
| 53 | chainID("0"),
|
---|
| 54 | resSeq("0"),
|
---|
| 55 | occupancy("0"),
|
---|
| 56 | tempFactor("0"),
|
---|
| 57 | segID("0"),
|
---|
| 58 | Charge("0"),
|
---|
| 59 | charge("0"),
|
---|
| 60 | GrpTypeNo("0"),
|
---|
| 61 | torsion("-"),
|
---|
[0bbfa1] | 62 | neighbors(std::vector<int>(0, 5)),
|
---|
| 63 | neighbors_processed(false)
|
---|
[031e2c6] | 64 | {}
|
---|
| 65 |
|
---|
| 66 | void TremoloAtomInfoContainer::set(TremoloKey::atomDataKey key, std::string value) {
|
---|
| 67 | switch (key) {
|
---|
| 68 | case TremoloKey::F :
|
---|
| 69 | F = value;
|
---|
| 70 | break;
|
---|
| 71 | case TremoloKey::stress :
|
---|
| 72 | stress = value;
|
---|
| 73 | break;
|
---|
| 74 | case TremoloKey::imprData :
|
---|
| 75 | imprData = value;
|
---|
| 76 | break;
|
---|
| 77 | case TremoloKey::GroupMeasureTypeNo :
|
---|
| 78 | GroupMeasureTypeNo = value;
|
---|
| 79 | break;
|
---|
[305e7e] | 80 | case TremoloKey::type :
|
---|
| 81 | type = value;
|
---|
[4d4d33] | 82 | break;
|
---|
[031e2c6] | 83 | case TremoloKey::extType :
|
---|
| 84 | extType = value;
|
---|
| 85 | break;
|
---|
| 86 | case TremoloKey::name :
|
---|
| 87 | name = value;
|
---|
| 88 | break;
|
---|
| 89 | case TremoloKey::resName :
|
---|
| 90 | resName = value;
|
---|
| 91 | break;
|
---|
| 92 | case TremoloKey::chainID :
|
---|
| 93 | chainID = value;
|
---|
| 94 | break;
|
---|
| 95 | case TremoloKey::resSeq :
|
---|
| 96 | resSeq = value;
|
---|
| 97 | break;
|
---|
| 98 | case TremoloKey::occupancy :
|
---|
| 99 | occupancy = value;
|
---|
| 100 | break;
|
---|
| 101 | case TremoloKey::tempFactor :
|
---|
| 102 | tempFactor = value;
|
---|
| 103 | break;
|
---|
| 104 | case TremoloKey::segID :
|
---|
| 105 | segID = value;
|
---|
| 106 | break;
|
---|
| 107 | case TremoloKey::Charge :
|
---|
| 108 | Charge = value;
|
---|
| 109 | break;
|
---|
| 110 | case TremoloKey::charge :
|
---|
| 111 | charge = value;
|
---|
| 112 | break;
|
---|
| 113 | case TremoloKey::GrpTypeNo :
|
---|
| 114 | GrpTypeNo = value;
|
---|
| 115 | break;
|
---|
| 116 | case TremoloKey::torsion :
|
---|
| 117 | torsion = value;
|
---|
| 118 | break;
|
---|
[ff3c40] | 119 | case TremoloKey::noKey :
|
---|
| 120 | break;
|
---|
[031e2c6] | 121 | default :
|
---|
| 122 | std::cout << "Unknown key: " << key << ", value: " << value << std::endl;
|
---|
| 123 | break;
|
---|
| 124 | }
|
---|
| 125 | }
|
---|
| 126 |
|
---|
[4d4d33] | 127 | std::string TremoloAtomInfoContainer::get(TremoloKey::atomDataKey key) const
|
---|
| 128 | {
|
---|
[031e2c6] | 129 | switch (key) {
|
---|
| 130 | case TremoloKey::F :
|
---|
| 131 | return F;
|
---|
| 132 | case TremoloKey::stress :
|
---|
| 133 | return stress;
|
---|
| 134 | case TremoloKey::imprData :
|
---|
| 135 | return imprData;
|
---|
| 136 | case TremoloKey::GroupMeasureTypeNo :
|
---|
| 137 | return GroupMeasureTypeNo;
|
---|
[305e7e] | 138 | case TremoloKey::type :
|
---|
| 139 | return type;
|
---|
[031e2c6] | 140 | case TremoloKey::extType :
|
---|
| 141 | return extType;
|
---|
| 142 | case TremoloKey::name :
|
---|
| 143 | return name;
|
---|
| 144 | case TremoloKey::resName :
|
---|
| 145 | return resName;
|
---|
| 146 | case TremoloKey::chainID :
|
---|
| 147 | return chainID;
|
---|
| 148 | case TremoloKey::resSeq :
|
---|
| 149 | return resSeq;
|
---|
| 150 | case TremoloKey::occupancy :
|
---|
| 151 | return occupancy;
|
---|
| 152 | case TremoloKey::tempFactor :
|
---|
| 153 | return tempFactor;
|
---|
| 154 | case TremoloKey::segID :
|
---|
| 155 | return segID;
|
---|
| 156 | case TremoloKey::Charge :
|
---|
| 157 | return Charge;
|
---|
| 158 | case TremoloKey::charge :
|
---|
| 159 | return charge;
|
---|
| 160 | case TremoloKey::GrpTypeNo :
|
---|
| 161 | return GrpTypeNo;
|
---|
| 162 | case TremoloKey::torsion :
|
---|
| 163 | return torsion;
|
---|
[ff3c40] | 164 | case TremoloKey::noKey :
|
---|
| 165 | return std::string("noKey"); // warning string
|
---|
[031e2c6] | 166 | default :
|
---|
| 167 | std::cout << "Unknown key: " << key << std::endl;
|
---|
| 168 | return "";
|
---|
| 169 | }
|
---|
| 170 | }
|
---|
| 171 |
|
---|
[4d4d33] | 172 | std::ostream& operator<<(std::ostream& out, const TremoloAtomInfoContainer& info)
|
---|
| 173 | {
|
---|
| 174 | out << info.get(TremoloKey::F) << "\t";
|
---|
| 175 | out << info.get(TremoloKey::stress) << "\t";
|
---|
| 176 | out << info.get(TremoloKey::imprData) << "\t";
|
---|
| 177 | out << info.get(TremoloKey::GroupMeasureTypeNo) << "\t";
|
---|
[305e7e] | 178 | out << info.get(TremoloKey::type) << "\t";
|
---|
[4d4d33] | 179 | out << info.get(TremoloKey::extType) << "\t";
|
---|
| 180 | out << info.get(TremoloKey::name) << "\t";
|
---|
| 181 | out << info.get(TremoloKey::resName) << "\t";
|
---|
| 182 | out << info.get(TremoloKey::chainID) << "\t";
|
---|
| 183 | out << info.get(TremoloKey::resSeq) << "\t";
|
---|
| 184 | out << info.get(TremoloKey::occupancy) << "\t";
|
---|
| 185 | out << info.get(TremoloKey::tempFactor) << "\t";
|
---|
| 186 | out << info.get(TremoloKey::segID) << "\t";
|
---|
| 187 | out << info.get(TremoloKey::Charge) << "\t";
|
---|
| 188 | out << info.get(TremoloKey::charge) << "\t";
|
---|
| 189 | out << info.get(TremoloKey::GrpTypeNo) << "\t";
|
---|
| 190 | out << info.get(TremoloKey::torsion) << "\t";
|
---|
| 191 | out << info.neighbors << "\t";
|
---|
| 192 | out << info.neighbors_processed;
|
---|
| 193 |
|
---|
| 194 | return out;
|
---|
| 195 | }
|
---|