-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResParser.h
More file actions
80 lines (62 loc) · 1.9 KB
/
ResParser.h
File metadata and controls
80 lines (62 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: ResParser.h
* Author: tg
*
* Created on June 6, 2020, 9:56 PM
*/
#ifndef RESPARSER_H
#define RESPARSER_H
#include<string>
#include<vector>
#include "ShelxState.h"
#include "SymOp.h"
#include "Restraint.h"
#include "xAtom.h"
class ResParser {
private:
const std::string resfile_;
short verbosity_;
std::vector<std::string> reslines_;
float lambda_;
float a_, b_, c_, alpha_, beta_, gamma_;
ShelxState shelxState_;
// derived from eqivs: $n corresponds to symop at position n
std::vector<SymOp> eqivs_;
// list of restraints
std::vector<Restraint> restraints_;
// list of atoms
std::vector<xAtom> xatoms_;
// read res-file
void readres(const std::string& filename);
// interprete res-file and extract values
bool xcmd(const std::string& instr);
// read cell from a linw
void getcell(const std::string& line);
void resi(const std::string& line);
void part(const std::string& line);
// process DFIX and DANG line
void addrestraint(const std::string& line);
// interpret res-file
void interpres();
// return upper case version of string
std::string upcase(const std::string& word);
public:
ResParser(const char* resfile, const short& verbosity);
~ResParser(){};
// create numeric restraints
std::vector<Restraint::Numeric> restraints() const;
// return cell parameters
float a() const { return a_; }
float b() const { return b_; }
float c() const { return c_; }
float alpha() const { return alpha_; }
float beta() const { return beta_; }
float gamma() const { return gamma_; }
float lambda() const { return lambda_; }
};
#endif /* RESPARSER_H */