|
CellModules
|
Represents a cell in the simulation. More...
#include <PrimoCell.hpp>
Public Types | |
| using | Cell = PrimoCell |
| using | World = MecaCell::World< PrimoCell< B > > |
| using | body_t = B< PrimoCell< B > > |
| using | embedded_plugin_t = typename body_t::embedded_plugin_t |
Public Member Functions | |
| void | setWorld (World *w) |
| Checks consistency with the world already injected at construction. More... | |
| PrimoCell (const MecaCell::Vec &v, Model &m, World &w) | |
| Constructs a PrimoCell with a position and model. More... | |
| PrimoCell (Model &m, World &w) | |
| Constructs a PrimoCell with a model. More... | |
| PrimoCell (PrimoCell< B > *mother) | |
| Constructs a PrimoCell from a mother cell. More... | |
| void | init () |
| Initializes the cell. More... | |
| Model & | getModel () const |
| @ignore More... | |
| Type | getType () const |
| Gets the type of the cell. More... | |
| void | setType (Type t) |
| Sets the type of the cell and modifies parameters accordingly. More... | |
| State | getState () |
| Gets the state of the cell. More... | |
| void | setState (State s) |
| Sets the state of the cell. More... | |
| double | getRadius () |
| Gets the radius of the cell. More... | |
| void | setRadius (const double &_radius) |
| Sets the radius of the cell. More... | |
| void | setPosition (const MecaCell::Vec &_pos) |
| Sets the position of the cell. More... | |
| bool | isType (Type t) |
| Checks if the cell is of a specific type. More... | |
| bool | isInContactWith (Type t) |
| Checks if the cell is in contact with a cell of a specific type. More... | |
| int | countNeighborType (Type t) |
| Counts the number of neighboring cells of a specific type. More... | |
| bool | isInContact () |
| Checks if the cell is in contact with any other cell. More... | |
| void | updateBehavior () |
| @ignore More... | |
| int | getId () const |
| Gets the ID of the cell. More... | |
| int | getMotherId () const |
| Gets the mother ID of the cell. More... | |
| const PreSetCell & | getParametersFrom (Type type) const |
| Gets the parameters for a specific cell type. More... | |
| void | eraseConnectedCell (PrimoCell< B > *cell) |
| disconnect a neighboring cell More... | |
| void | addConnectedCell (PrimoCell< B > *c) |
| void | clearConnectedCells () |
| bool | isConnectedTo (PrimoCell< B > *c) |
| void | die () |
| flags the cell as dead so it can be cleanly removed from the world More... | |
| bool | isDead () |
| Vector3D | getPosition () const |
| void | setColorRGB (size_t r, size_t g, size_t b) |
| void | setColorRGB (std::array< int, 3 > rgb) |
| void | setColorRGB (std::array< double, 3 > rgb) |
| void | setColorHSV (double H, double S, double V) |
| void | setColorHSV (std::array< double, 3 > hsv) |
| void | setVisible (bool v) |
| should a viewer displpay this cell ? More... | |
| string | toString () |
| dumps internal infos More... | |
| body_t & | getBody () |
| const body_t & | getConstBody () const |
| double | getBoundingBoxRadius () const |
| double | getColor (unsigned int i) const |
| const std::vector< PrimoCell< B > * > & | getConnectedCells () const |
| bool | getVisible () |
| int | getNbConnections () const |
| EXPORTABLE (ConnectableCell, KV(body), KV(id)) | |
Public Attributes | |
| int | mother_id = -1 |
| @ignore More... | |
| friend | body_t |
| friend | embedded_plugin_t |
| size_t | id |
Protected Member Functions | |
| PrimoCell< B > * | selfptr () |
| PrimoCell< B > & | self () |
| const PrimoCell< B > & | selfconst () const |
Protected Attributes | |
| body_t | body |
| bool | dead |
| bool | isVisible |
| array< double, 3 > | color |
| unique_vector< PrimoCell< B > * > | connectedCells |
Private Types | |
| using | Base = MecaCell::ConnectableCell< PrimoCell< B >, B > |
Private Member Functions | |
| void | behave () |
| @ignore More... | |
| void | nextState () |
| @ignore More... | |
| Cell * | createCell () |
| Creates a new cell. More... | |
| Cell * | createCell (Type t) |
| Creates a new cell of a specific type. More... | |
Private Attributes | |
| Model & | model |
| @ignore More... | |
| Type | type |
| Current type of the cell. More... | |
| State | state |
| Current state of the cell's internal state machine. More... | |
| World & | world |
| bool | _alreadyNextState = false |
| @ignore More... | |
| bool | _firstInit = true |
| @ignore More... | |
Represents a cell in the simulation.
| B | The base class template. |
Definition at line 59 of file PrimoCell.hpp.
|
private |
Definition at line 60 of file PrimoCell.hpp.
|
inherited |
Definition at line 36 of file connectablecell.hpp.
Definition at line 62 of file PrimoCell.hpp.
|
inherited |
Definition at line 37 of file connectablecell.hpp.
| using PrimoCell< B >::World = MecaCell::World<PrimoCell<B> > |
Definition at line 63 of file PrimoCell.hpp.
|
inline |
Constructs a PrimoCell with a position and model.
| v | The position vector. |
| m | Reference to the model. |
Definition at line 196 of file PrimoCell.hpp.
|
inline |
Constructs a PrimoCell with a model.
| m | Reference to the model. |
Definition at line 207 of file PrimoCell.hpp.
|
inline |
Constructs a PrimoCell from a mother cell.
| mother | Pointer to the mother cell. |
Definition at line 218 of file PrimoCell.hpp.
|
inlineinherited |
Definition at line 70 of file connectablecell.hpp.
|
inlineprivate |
@ignore
Definition at line 93 of file PrimoCell.hpp.
|
inlineinherited |
Definition at line 71 of file connectablecell.hpp.
|
inline |
Counts the number of neighboring cells of a specific type.
| t | The type to count. |
Definition at line 321 of file PrimoCell.hpp.
Creates a new cell.
The new cell is initialized with the same Type as the mother cell and added to the world.
Definition at line 133 of file PrimoCell.hpp.
Creates a new cell of a specific type.
The new cell is initialized with the specified type and added to the world.
| t | The type of the new cell. |
Definition at line 152 of file PrimoCell.hpp.
|
inlineinherited |
flags the cell as dead so it can be cleanly removed from the world
Definition at line 118 of file connectablecell.hpp.
|
inlineinherited |
disconnect a neighboring cell
removes it from the connectedCells contianer
| cell | pointer to the cell to be disconnected |
Definition at line 69 of file connectablecell.hpp.
|
inherited |
|
inlineinherited |
Definition at line 152 of file connectablecell.hpp.
|
inlineinherited |
Definition at line 154 of file connectablecell.hpp.
|
inlineinherited |
Definition at line 155 of file connectablecell.hpp.
|
inlineinherited |
Definition at line 159 of file connectablecell.hpp.
|
inlineinherited |
Definition at line 153 of file connectablecell.hpp.
|
inline |
@ignore
Definition at line 244 of file PrimoCell.hpp.
|
inline |
Gets the mother ID of the cell.
Definition at line 354 of file PrimoCell.hpp.
|
inlineinherited |
Definition at line 163 of file connectablecell.hpp.
|
inline |
Gets the parameters for a specific cell type.
| type | The type of the cell. |
Definition at line 363 of file PrimoCell.hpp.
|
inlineinherited |
Definition at line 120 of file connectablecell.hpp.
|
inline |
Gets the radius of the cell.
Definition at line 279 of file PrimoCell.hpp.
|
inline |
Gets the state of the cell.
Definition at line 265 of file PrimoCell.hpp.
|
inline |
Gets the type of the cell.
Definition at line 251 of file PrimoCell.hpp.
|
inlineinherited |
Definition at line 162 of file connectablecell.hpp.
|
inline |
Initializes the cell.
This function resets the cell's parameters and calls the code inside the "Cell Instantiation".
Definition at line 230 of file PrimoCell.hpp.
|
inlineinherited |
Definition at line 72 of file connectablecell.hpp.
|
inlineinherited |
Definition at line 119 of file connectablecell.hpp.
|
inline |
Checks if the cell is in contact with any other cell.
Definition at line 333 of file PrimoCell.hpp.
|
inline |
Checks if the cell is in contact with a cell of a specific type.
| t | The type to check. |
Definition at line 309 of file PrimoCell.hpp.
|
inline |
Checks if the cell is of a specific type.
| t | The type to check. |
Definition at line 301 of file PrimoCell.hpp.
|
inlineprivate |
@ignore
Definition at line 110 of file PrimoCell.hpp.
|
inlineprotectedinherited |
Definition at line 58 of file connectablecell.hpp.
|
inlineprotectedinherited |
Definition at line 59 of file connectablecell.hpp.
|
inlineprotectedinherited |
Definition at line 57 of file connectablecell.hpp.
|
inlineinherited |
Definition at line 128 of file connectablecell.hpp.
|
inlineinherited |
Definition at line 129 of file connectablecell.hpp.
|
inlineinherited |
Definition at line 122 of file connectablecell.hpp.
|
inlineinherited |
Definition at line 127 of file connectablecell.hpp.
|
inlineinherited |
Definition at line 126 of file connectablecell.hpp.
|
inline |
Sets the position of the cell.
| _pos | The position vector. |
Definition at line 293 of file PrimoCell.hpp.
|
inline |
Sets the radius of the cell.
| _radius | The radius to set. |
Definition at line 286 of file PrimoCell.hpp.
|
inline |
Sets the state of the cell.
| s | The state to set. |
Definition at line 272 of file PrimoCell.hpp.
|
inline |
Sets the type of the cell and modifies parameters accordingly.
| t | The type to set. |
Definition at line 258 of file PrimoCell.hpp.
|
inlineinherited |
should a viewer displpay this cell ?
| v |
Definition at line 136 of file connectablecell.hpp.
Checks consistency with the world already injected at construction.
| w | Pointer to the world. @ignore |
Definition at line 173 of file PrimoCell.hpp.
|
inlineinherited |
|
inline |
@ignore
Definition at line 336 of file PrimoCell.hpp.
|
private |
@ignore
Definition at line 87 of file PrimoCell.hpp.
|
private |
@ignore
Definition at line 89 of file PrimoCell.hpp.
|
protectedinherited |
Definition at line 43 of file connectablecell.hpp.
|
inherited |
Definition at line 39 of file connectablecell.hpp.
|
protectedinherited |
Definition at line 51 of file connectablecell.hpp.
|
protectedinherited |
Definition at line 54 of file connectablecell.hpp.
|
protectedinherited |
Definition at line 44 of file connectablecell.hpp.
|
inherited |
Definition at line 40 of file connectablecell.hpp.
|
inherited |
Definition at line 74 of file connectablecell.hpp.
|
protectedinherited |
Definition at line 49 of file connectablecell.hpp.
@ignore
Definition at line 66 of file PrimoCell.hpp.
| int PrimoCell< B >::mother_id = -1 |
@ignore
Definition at line 165 of file PrimoCell.hpp.
|
private |
Current state of the cell's internal state machine.
This value determines which behavior branch is executed during updates. In the isicell platform, each state corresponds to a block in the state machine.
Definition at line 82 of file PrimoCell.hpp.
|
private |
Current type of the cell.
The type is used to select parameter presets and can affect the behavior and state transitions of the cell.
Definition at line 74 of file PrimoCell.hpp.
Definition at line 84 of file PrimoCell.hpp.