6#ifndef BASEPROJECT_Cell_HPP
7#define BASEPROJECT_Cell_HPP
11#include "../core/Model.hpp"
12#include "../tools/TimeConvert.hpp"
13#include "../tools/RandomManager.hpp"
58template<
template<
typename>
class B>
103 cout <<
"UNSPECIFIED CELL STATE : " <<
static_cast<unsigned int>(this->
state) <<
endl;
134 int idMother = this->
id;
136 daughter->mother_id = idMother;
139 daughter->setType(this->type);
153 int idMother = this->
id;
155 daughter->mother_id = idMother;
158 daughter->setType(t);
199 this->
getBody().setPosition(v);
240 this->_alreadyNextState =
true;
301 bool isType(Type t) {
return this->type == t;}
311 if(c->isType(t))
return true;
324 if(c->isType(t)) count++;
337 this->_alreadyNextState =
false;
339 if(!this->_alreadyNextState)
nextState();
Model::PreSetCell PreSetCell
Basis for every cell a user might want to use.
Vector3D getPosition() const
const std::vector< PrimoCell< B > * > & getConnectedCells() const
general purpose 3D vector/point class.
Where "everything" happens.
void addCell(Cell *c)
adds a cell to the new cells batch (which will be added to the main cells container at the end of the...
const PreSetCell & getPreSetCell(Type type) const
Represents a cell in the simulation.
PrimoCell(Model &m, World &w)
Constructs a PrimoCell with a model.
bool isType(Type t)
Checks if the cell is of a specific type.
void init()
Initializes the cell.
void setPosition(const MecaCell::Vec &_pos)
Sets the position of the cell.
State state
Current state of the cell's internal state machine.
int countNeighborType(Type t)
Counts the number of neighboring cells of a specific type.
bool isInContactWith(Type t)
Checks if the cell is in contact with a cell of a specific type.
PrimoCell(PrimoCell< B > *mother)
Constructs a PrimoCell from a mother cell.
void updateBehavior()
@ignore
State getState()
Gets the state of the cell.
PrimoCell(const MecaCell::Vec &v, Model &m, World &w)
Constructs a PrimoCell with a position and model.
int getId() const
Gets the ID of the cell.
Type type
Current type of the cell.
Type getType() const
Gets the type of the cell.
bool isInContact()
Checks if the cell is in contact with any other cell.
double getRadius()
Gets the radius of the cell.
void setState(State s)
Sets the state of the cell.
Cell * createCell(Type t)
Creates a new cell of a specific type.
int getMotherId() const
Gets the mother ID of the cell.
void setRadius(const double &_radius)
Sets the radius of the cell.
const PreSetCell & getParametersFrom(Type type) const
Gets the parameters for a specific cell type.
Model & getModel() const
@ignore
Cell * createCell()
Creates a new cell.
void setWorld(World *w)
Checks consistency with the world already injected at construction.
void setType(Type t)
Sets the type of the cell and modifies parameters accordingly.
bool _alreadyNextState
@ignore
this file contains various miscellanious utility functions & helpers *
Vector3D Vec
alias for Vector3D
iostream cout
Standard output stream.
iostream endl
End-of-line manipulator.