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"
52template<
template<
typename>
class B>
81 cout <<
"UNSPECIFIED CELL STATE : " <<
static_cast<unsigned int>(this->
state) <<
endl;
115 daughter->mother_id = idMother;
118 daughter->setType(this->type);
135 daughter->mother_id = idMother;
138 daughter->setType(t);
180 this->
getBody().setPosition(v);
222 this->_alreadyNextState =
true;
283 bool isType(Type t) {
return this->type == t;}
293 if(c->isType(t))
return true;
306 if(c->isType(t)) count++;
319 this->_alreadyNextState =
false;
321 if(!this->_alreadyNextState)
nextState();
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...
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.
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 getType() const
Gets the type of the cell.
Model * getModel() const
@ignore
PrimoCell(Model *m)
Constructs a PrimoCell with a model.
static int id_count
@ignore
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.
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.