-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdistancelib.hpp
More file actions
54 lines (45 loc) · 1.01 KB
/
distancelib.hpp
File metadata and controls
54 lines (45 loc) · 1.01 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
#include"camera.hpp"
std::istream& operator>>( std::istream& is, WorldPoints& t){
is>>t.id;
is>>t.x;
is>>t.y;
is>>t.z;
return is;
}
std::istream& operator>>( std::istream& is, Ellipse& p){
is>>p.id;
is>>p.x;
is>>p.y;
is>>p.b;
is>>p.e;
is>>p.phi;
return is;
}
//read all pmts in sk detector.
std::vector<WorldPoints> read_all_world_points(std::string filename="SK_all_PMT_locations.txt"){
std::vector<WorldPoints> all_pmts;
WorldPoints t; //temporary container
std::ifstream myfile(filename);
while (myfile >> t) {
all_pmts.push_back(t);
}
myfile.close();
return all_pmts;
}
//read pmts from an image.
std::vector<Ellipse> read_ellipses_in_image(std::string filename ="045.txt"){
std::vector<Ellipse>ellipses;
Ellipse e;
std::ifstream myfile(filename);
while(myfile>>e){
ellipses.push_back(e);
}
return ellipses;
}
unsigned get_img_num(std::string filename){
unsigned img_num;
std::stringstream ss;
ss << filename;
ss >> img_num;
return img_num;
}