-
Notifications
You must be signed in to change notification settings - Fork 0
/
defclasspixM.h
100 lines (87 loc) · 2.37 KB
/
defclasspixM.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#pragma once
class pixM
{
public:
// Initial States matrix
vector<istate> istatesm;
// Pix matrix
vector<Pix> pixm;
// Pix-pointers matrix
vector<Pix*> ptrpixm;
// Pix-processors matrix
vector<procPix> procm;
// Pix-processors pointers matrix
vector<procPix*> ptrprocm;
bool loaded = false;
ALLEGRO_COLOR messagecolor = _white;
// Physical characteristics
// Color
ALLEGRO_COLOR scolor;
// Flag for default color
bool selfcolor;
// Gravity constant (Newton's)
double G;
// Electric constant (Coulomb's)
double K;
// Mass of each one of the particle's matrix
double m;
// Electrical charge of each one of the particle's matrix
double q;
// Initial velocity for each one of the particles
par v0;
// Number of particles - as float for
// better compatibility
double npix;
// Interactions processors
double nproc;
// Total mass of the system
double mass;
// Center of mass
par cm;
// Average velocity
par av;
// Velocity of center of mass
par vcm;
// Cinetic energy
double energy;
public:
// LOADING INITIAL STATES MATRIX
void loadistatesm(vector<istate> istatesm);
// After loading the initial states matrix
// can build the corresponding Pix matrix
void buildpixm();
// After Pix matrix is built, can build Pix pointers matrix
void buildptrpixm();
// Building the processors-matrix
void buildprocm();
// Building the pointers processors-matrix
void buildptrprocm();
// LOADING PIX-POINTERS MATRIX
void setnull();
pixM() { this->setnull(); }
~pixM() { this->setnull(); }
pixM init(vector<istate> istatesm);
void setup(vector<istate> istatesm);
void setdefaults(vector<istate> istatesm);
void setmessagecolor(ALLEGRO_COLOR messagecolor);
void drawloadingmessage();
// PHYSICAL PROPERTIES
void getnpix();
void getnproc();
void getmass();
void getcentermass();
void getaveragevelocity();
void getcentermassvelocity();
void getenergy();
// ANIMATION OPERATIONS
void getid();
void computexy();
void draw();
void setcolor(ALLEGRO_COLOR color);
void getscale(par exy);
void getbgcolor(bool blackbg, bool whitebg);
void setforegroundcolor();
void setconstants(double G, double K);
void dointeractions();
void run();
};