CellModules
|
Class for managing Delaunay triangulation and mass-spring-damper physics. More...
#include <PluginDelaunayMassSpringDamper.hpp>
Public Member Functions | |
PluginDelaunayMassSpringDamper () | |
Constructor. More... | |
void | setPhysicsDt (double dt) |
Sets the physics dt. More... | |
void | setCoherenceCoeff (double c) |
Sets the coherence coefficient. More... | |
void | setMaxSpeed (double s) |
Sets the maximum speed. More... | |
void | setMinForce (double f) |
Sets the minimum force. More... | |
void | setNeighbourCoeff (double c) |
Sets the neighbour coefficient. More... | |
template<typename world_t > | |
void | endUpdate (world_t *w) |
End update hook for MecaCell. More... | |
template<typename world_t > | |
void | onAddCell (world_t *w) |
On add cell hook for MecaCell. More... | |
template<typename world_t > | |
void | preBehaviorUpdate (world_t *w) |
Pre-behavior update hook for MecaCell. More... | |
template<typename world_t > | |
void | preDeleteDeadCellsUpdate (world_t *w) |
Pre-delete dead cells update hook for MecaCell. More... | |
Private Member Functions | |
bool | isDelaunayCoherent () |
Checks the coherence of the Delaunay triangulation. More... | |
void | moveDelaunay () |
Moves the points in the triangulation to match their real positions. More... | |
template<typename world_t > | |
void | computeDelaunay (world_t *w) |
Computes the Delaunay triangulation from the list of cells. More... | |
void | springCreation () |
Creates the list of springs. More... | |
template<typename world_t > | |
void | addCells (world_t *w) |
Adds new cells to the triangulation. More... | |
void | removeCells () |
Removes dead cells from the triangulation. More... | |
void | updateForces () |
Updates forces and checks if the forces are too weak to be considered. More... | |
template<typename world_t > | |
void | updatePositions (world_t *w) |
Updates positions and checks if the movements are too weak to be considered. More... | |
template<typename world_t > | |
void | resetForces (world_t *w) |
Resets the forces acting on the cells. More... | |
template<typename world_t > | |
void | applyPhysics (world_t *w) |
Applies the physics with a coherent time step. More... | |
Private Attributes | |
std::vector< MassSpringDamper< cell_t > > | springList |
Delaunay | triangulation |
bool | areForcesNegligible |
bool | areMovementsNegligible |
double | physicsDt = 0.01 |
double | maxSpeed = 10.0 |
double | minForce = 1.0 |
double | neighbourCoeff = 1.1 |
double | coherenceCoeff = 0.2 |
Class for managing Delaunay triangulation and mass-spring-damper physics.
cell_t | Type of the cell. |
Definition at line 37 of file PluginDelaunayMassSpringDamper.hpp.
|
inline |
Constructor.
Initializes the spring list and the triangulation.
Definition at line 258 of file PluginDelaunayMassSpringDamper.hpp.
|
inlineprivate |
Adds new cells to the triangulation.
world_t | Type of the world. |
w | Pointer to the world. |
Definition at line 158 of file PluginDelaunayMassSpringDamper.hpp.
|
inlineprivate |
Applies the physics with a coherent time step.
Applies the physics with a coherent physics dt. Stops when movements or forces are too weak.
world_t | Type of the world. |
w | Pointer to the world. |
Definition at line 241 of file PluginDelaunayMassSpringDamper.hpp.
|
inlineprivate |
Computes the Delaunay triangulation from the list of cells.
world_t | Type of the world. |
w | Pointer to the world. |
Definition at line 100 of file PluginDelaunayMassSpringDamper.hpp.
|
inline |
End update hook for MecaCell.
Recomputes or readjusts the triangulation and regenerates the springs.
world_t | Type of the world. |
w | Pointer to the world. |
Definition at line 299 of file PluginDelaunayMassSpringDamper.hpp.
|
inlineprivate |
Checks the coherence of the Delaunay triangulation.
Definition at line 54 of file PluginDelaunayMassSpringDamper.hpp.
|
inlineprivate |
Moves the points in the triangulation to match their real positions.
Definition at line 77 of file PluginDelaunayMassSpringDamper.hpp.
|
inline |
On add cell hook for MecaCell.
Adds the new cells to the triangulation.
world_t | Type of the world. |
w | Pointer to the world. |
Definition at line 313 of file PluginDelaunayMassSpringDamper.hpp.
|
inline |
Pre-behavior update hook for MecaCell.
Applies the physics to each cell.
world_t | Type of the world. |
w | Pointer to the world. |
Definition at line 326 of file PluginDelaunayMassSpringDamper.hpp.
|
inline |
Pre-delete dead cells update hook for MecaCell.
Removes the dead cells from the triangulation.
world_t | Type of the world. |
w | Pointer to the world. |
Definition at line 339 of file PluginDelaunayMassSpringDamper.hpp.
|
inlineprivate |
Removes dead cells from the triangulation.
Definition at line 173 of file PluginDelaunayMassSpringDamper.hpp.
|
inlineprivate |
Resets the forces acting on the cells.
world_t | Type of the world. |
w | Pointer to the world. |
Definition at line 225 of file PluginDelaunayMassSpringDamper.hpp.
|
inline |
Sets the coherence coefficient.
c | Coherence coefficient. |
Definition at line 270 of file PluginDelaunayMassSpringDamper.hpp.
|
inline |
Sets the maximum speed.
s | Maximum speed. |
Definition at line 276 of file PluginDelaunayMassSpringDamper.hpp.
|
inline |
Sets the minimum force.
f | Minimum force. |
Definition at line 282 of file PluginDelaunayMassSpringDamper.hpp.
|
inline |
Sets the neighbour coefficient.
c | Neighbour coefficient. |
Definition at line 288 of file PluginDelaunayMassSpringDamper.hpp.
|
inline |
Sets the physics dt.
dt | Physics dt. |
Definition at line 264 of file PluginDelaunayMassSpringDamper.hpp.
|
inlineprivate |
Creates the list of springs.
Definition at line 122 of file PluginDelaunayMassSpringDamper.hpp.
|
inlineprivate |
Updates forces and checks if the forces are too weak to be considered.
Definition at line 188 of file PluginDelaunayMassSpringDamper.hpp.
|
inlineprivate |
Updates positions and checks if the movements are too weak to be considered.
world_t | Type of the world. |
w | Pointer to the world. |
Definition at line 205 of file PluginDelaunayMassSpringDamper.hpp.
|
private |
Definition at line 42 of file PluginDelaunayMassSpringDamper.hpp.
|
private |
Definition at line 43 of file PluginDelaunayMassSpringDamper.hpp.
|
private |
Coefficient used to determine the spatial coherence of each cell
Definition at line 48 of file PluginDelaunayMassSpringDamper.hpp.
|
private |
Max velocity of a cell in µm/s
Definition at line 45 of file PluginDelaunayMassSpringDamper.hpp.
|
private |
Minimal force to consider in pN
Definition at line 46 of file PluginDelaunayMassSpringDamper.hpp.
|
private |
Coefficient used to set the maximal distance to consider 2 cells as neighbours
Definition at line 47 of file PluginDelaunayMassSpringDamper.hpp.
|
private |
Physical dt is set to 0.01s supposing w->dt is in seconds
Definition at line 44 of file PluginDelaunayMassSpringDamper.hpp.
|
private |
List of springs representing the connections between cells
Definition at line 40 of file PluginDelaunayMassSpringDamper.hpp.
|
private |
Contains and computes the Delaunay triangulation of the cells
Definition at line 41 of file PluginDelaunayMassSpringDamper.hpp.