source: src/Parser/TremoloAtomInfoContainer.cpp@ ff4fff9

CombiningParticlePotentialParsing
Last change on this file since ff4fff9 was 94d5ac6, checked in by Frederik Heber <heber@…>, 12 years ago

FIX: As we use GSL internally, we are as of now required to use GPL v2 license.

  • GNU Scientific Library is used at every place in the code, especially the sub-package LinearAlgebra is based on it which in turn is used really everywhere in the remainder of MoleCuilder. Hence, we have to use the GPL license for the whole of MoleCuilder. In effect, GPL's COPYING was present all along and stated the terms of the GPL v2 license.
  • Hence, I added the default GPL v2 disclaimer to every source file and removed the note about a (actually missing) LICENSE file.
  • also, I added a help-redistribute action which again gives the disclaimer of the GPL v2.
  • also, I changed in the disclaimer that is printed at every program start in builder_init.cpp.
  • TEST: Added check on GPL statement present in every module to test CodeChecks project-disclaimer.
  • Property mode set to 100644
File size: 5.0 KB
Line 
1/*
2 * Project: MoleCuilder
3 * Description: creates and alters molecular systems
4 * Copyright (C) 2010-2012 University of Bonn. All rights reserved.
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/>.
21 */
22
23/*
24 * TremoloAtomInfoContainer.cpp
25 *
26 * Created on: Dec 7, 2010
27 * Author: heber
28 */
29
30// include config.h
31#ifdef HAVE_CONFIG_H
32#include <config.h>
33#endif
34
35#include "CodePatterns/MemDebug.hpp"
36
37#include "CodePatterns/toString.hpp"
38
39#include <iostream>
40
41#include "TremoloAtomInfoContainer.hpp"
42
43
44TremoloAtomInfoContainer::TremoloAtomInfoContainer() :
45 F("0"),
46 stress("0"),
47 imprData("-"),
48 GroupMeasureTypeNo("0"),
49 type("-"),
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("-"),
62 neighbors(std::vector<int>(0, 5)),
63 neighbors_processed(false)
64{}
65
66void 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;
80 case TremoloKey::type :
81 type = value;
82 break;
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;
119 case TremoloKey::noKey :
120 break;
121 default :
122 std::cout << "Unknown key: " << key << ", value: " << value << std::endl;
123 break;
124 }
125}
126
127std::string TremoloAtomInfoContainer::get(TremoloKey::atomDataKey key) const
128{
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;
138 case TremoloKey::type :
139 return type;
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;
164 case TremoloKey::noKey :
165 return std::string("noKey"); // warning string
166 default :
167 std::cout << "Unknown key: " << key << std::endl;
168 return "";
169 }
170}
171
172std::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";
178 out << info.get(TremoloKey::type) << "\t";
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}
Note: See TracBrowser for help on using the repository browser.