Loading [MathJax]/extensions/tex2jax.js
PixCells
This project is a Cellular Potts Model (CPM) simulator. It was developped during a Master's degree in Physics as a master project.
All Classes Files Functions Pages
Cell.hpp
Go to the documentation of this file.
1
9#ifndef CELL_HPP
10#define CELL_HPP
11
12#include <SFML/Graphics.hpp>
13#include <vector>
14
15class Cell{
16
17private:
18 /* data */
19 int m_id;
20 int m_type;
21
22 float m_length;
23 int m_target_surface;
24 float m_target_length;
25 // color of the cell
26 sf::Color m_color;
27
28 // Position of each case of the cell
29 std::vector<std::pair<int, int>> m_position;
30
31 public:
32
33 // Constructor/Destructor
34 Cell(int id, int type, int target_surface, float target_length, sf::Color color);
35 ~Cell();
36
37 // Getters
38 int get_id();
39 int get_type();
40 float get_length();
42 float get_target_length();
43 sf::Color get_color();
44 std::vector<std::pair<int, int>> get_position();
45
46 // Setters
47 void set_id(int id);
48 void set_type(int type);
49 void set_target_surface(int target_surface);
50 void set_target_length(float target_length);
51 void set_color(sf::Color color);
52
53 void add_position(int x, int y);
54 void remove_position(int x, int y);
55 void clear_position();
56
57 // Printer
58 void print();
59
60 // Update the length of the cell
61
62 void update_length();
63};
64
65
66
67#endif // CELL_HPP
Definition Cell.hpp:15
void remove_position(int x, int y)
Remove a position from the cell.
Definition Cell.cpp:206
void set_target_length(float target_length)
Set the target length of the cell.
Definition Cell.cpp:152
float get_target_length()
Get the target length of the cell.
Definition Cell.cpp:92
std::vector< std::pair< int, int > > get_position()
Get the position of the cell.
Definition Cell.cpp:110
int get_type()
Get the type of the cell.
Definition Cell.cpp:65
int get_target_surface()
Get the target surface of the cell.
Definition Cell.cpp:83
float get_length()
Get the length of the cell.
Definition Cell.cpp:74
void add_position(int x, int y)
Add a position to the cell.
Definition Cell.cpp:195
void set_color(sf::Color color)
Set the color of the cell.
Definition Cell.cpp:162
void set_type(int type)
Set the type of the cell.
Definition Cell.cpp:132
~Cell()
Destroy the Cell:: Cell object.
Definition Cell.cpp:45
void update_length()
Update the length of the cell.
Definition Cell.cpp:231
int get_id()
Get the id of the cell.
Definition Cell.cpp:56
void clear_position()
Clear the position of the cell.
Definition Cell.cpp:222
void print()
Print the cell in the console.
Definition Cell.cpp:173
void set_target_surface(int target_surface)
Set the target surface of the cell.
Definition Cell.cpp:142
void set_id(int id)
Set the id of the cell.
Definition Cell.cpp:122
sf::Color get_color()
Get the color of the cell.
Definition Cell.cpp:101