-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcluster.h
50 lines (41 loc) · 1.15 KB
/
cluster.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
#ifndef CLUSTER_H
#define CLUSTER_H
#include <vector>
#include <string>
#include <iostream>
using namespace std;
struct Pixel
{
int xPos;
int yPos;
int tot;
double energy;
};
class Cluster
{
public :
void AddPixel(string pixelLine);
Pixel & GetPixel(int which){return m_pixels[which];};
void SetSize(int size){m_size = size;};
int GetSize(void){return m_size;};
double GetEnergy(void);
double GetXPos(void){return m_xPos;};
double GetYPos(void){return m_yPos;};
void SetXPos(double xPos){m_xPos = xPos;};
void SetYPos(double yPos){m_yPos = yPos;};
void SetGood(bool isGood){m_good = isGood;};
bool GetGood(void){return m_good;};
void ShrinkSize(int which){m_size--;m_pixels.erase(m_pixels.begin() + which);};
int GetXPos(int which){return m_pixels[which].xPos;};
int GetYPos(int which){return m_pixels[which].yPos;};
int GetTot(int which){return m_pixels[which].tot;};
double GetEnergy(int which){return m_pixels[which].energy;};
void SetEnergy(int which,double energy){m_pixels[which].energy = energy;};
private :
vector<Pixel> m_pixels;
int m_size;
double m_xPos;
double m_yPos;
bool m_good;
};
#endif