-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPotWell.cpp
More file actions
62 lines (47 loc) · 1.13 KB
/
PotWell.cpp
File metadata and controls
62 lines (47 loc) · 1.13 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
#include <algorithm>
#include <iostream>
#include "PotWell.h"
PotWell::PotWell(std::string direction, double depth, double width){
set_direction(direction);
set_depth(depth);
set_width(width);
}
void PotWell::set_direction(std::string direction){
direction_ = direction;
std::transform(direction_.begin(), direction_.end(), direction_.begin(), ::tolower);
if (direction == "x") {
num_direction_ = 1;
} else if (direction == "y") {
num_direction_ = 2;
} else if (direction == "z") {
num_direction_ = 3;
} else {
std::cerr << "Direction not recognized. Default direction (x) initialized." << std::endl;
num_direction_ = 1;
direction_ = "x";
}
}
void PotWell::set_depth(double depth){
depth_ = depth;
}
void PotWell::set_width(double width){
width_ = width;
}
void PotWell::set_width_in_cm(double width_in_cm){
width_in_cm_ = width_in_cm;
}
double PotWell::width_in_cm(){
return width_in_cm_;
}
double PotWell::depth(){
return depth_;
}
double PotWell::width(){
return width_;
}
std::string PotWell::direction(){
return direction_;
}
int PotWell::num_direction(){
return num_direction_;
}