6#ifndef BASEPROJECT_Cell_HPP
7#define BASEPROJECT_Cell_HPP
10#include "../core/Model.hpp"
11#include "../tools/TimeConvert.hpp"
12#include "../tools/RandomManager.hpp"
57template<
template<
typename>
class B>
102 cout <<
"UNSPECIFIED CELL STATE : " <<
static_cast<unsigned int>(this->
state) <<
endl;
133 int idMother = this->
id;
135 daughter->mother_id = idMother;
138 daughter->setType(this->type);
152 int idMother = this->
id;
154 daughter->mother_id = idMother;
157 daughter->setType(t);
198 this->
getBody().setPosition(v);
239 this->_alreadyNextState =
true;
300 bool isType(Type t) {
return this->type == t;}
310 if(c->isType(t))
return true;
323 if(c->isType(t)) count++;
336 this->_alreadyNextState =
false;
338 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.
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.
PrimoCell(const MecaCell::Vec &v, Model *m)
Constructs a PrimoCell with a position and model.
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.
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.
Model * getModel() const
@ignore
PrimoCell(Model *m)
Constructs a PrimoCell with a model.
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.
Cell * createCell()
Creates a new cell.
void setWorld(World *w)
Sets the world for the cell.
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.