-
Notifications
You must be signed in to change notification settings - Fork 4
/
Site.h
62 lines (53 loc) · 978 Bytes
/
Site.h
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
#ifndef INCLUDED_SITE_H
#define INCLUDED_SITE_H
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <rpc/xdr.h>
#include <argp.h>
#include <vector>
#include <math.h>
#include <string.h>
//#include <tr1/unordered_map>
#include <unordered_map>
#include <string>
#include <sstream>
class Site {
public:
Site()
{
this->x = 0;
this->y = 0;
this->z = 0;
}
void set(uint32_t x, uint32_t y, uint32_t z) {
this->x = x;
this->y = y;
this->z = z;
}
uint32_t x, y, z;
void print(FILE *outfile) {
fprintf(outfile, "%u %u %u", x, y, z);
}
void print(FILE *outfile, double voxelsz) {
fprintf(outfile, "%f %f %f", x * voxelsz, y * voxelsz, z * voxelsz);
}
bool equals(uint32_t a, uint32_t b, uint32_t c)
{
if(a != x) {
return false;
}
if(b != y) {
return false;
}
if(c != z) {
return false;
}
return true;
}
bool equals(Site *s)
{
return equals(s->x, s->y, s->z);
}
};
#endif