CellModules
|
Basis for every cell a user might want to use. More...
#include <connectablecell.hpp>
Public Types | |
using | body_t = Body< Derived > |
using | embedded_plugin_t = typename body_t::embedded_plugin_t |
Public Member Functions | |
void | eraseConnectedCell (Derived *cell) |
disconnect a neighboring cell More... | |
void | addConnectedCell (Derived *c) |
void | clearConnectedCells () |
bool | isConnectedTo (Derived *c) |
size_t | getId () const |
ConnectableCell (const Derived &c) | |
ConnectableCell (const ConnectableCell &c) | |
ConnectableCell (const Derived *c) | |
Copy constructor. More... | |
ConnectableCell (Vec pos) | |
Constructor. More... | |
ConnectableCell () | |
ConnectableCell (const Derived &c, const Vec &translation) | |
Copy constructor with translation. More... | |
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< Derived * > & | getConnectedCells () const |
bool | getVisible () |
int | getNbConnections () const |
EXPORTABLE (ConnectableCell, KV(body), KV(id)) | |
Public Attributes | |
friend | body_t |
friend | embedded_plugin_t |
size_t | id = 0 |
Protected Member Functions | |
Derived * | selfptr () |
Derived & | self () |
const Derived & | selfconst () const |
Protected Attributes | |
body_t | body |
bool | dead = false |
bool | isVisible = true |
array< double, 3 > | color |
unique_vector< Derived * > | connectedCells |
Basis for every cell a user might want to use.
It uses the curriously reccuring template pattern : Derived is the user's type inheriting ConnectableCell. Body is the type of body used by the cell. A body is a low level class that handles everything related to physics (deformations, connections, volume). A ConnectableCell is a more abstract interface meant to expose higher instinctive, meaningful parameters and methods. It also represents the cell's center, which can be seen as its kernel (it is NOT always the center of mass, but often close enough)
Body | the body implementation (which contains most of the core logic) |
Definition at line 34 of file connectablecell.hpp.
using MecaCell::ConnectableCell< Derived, Body >::body_t = Body<Derived> |
Definition at line 36 of file connectablecell.hpp.
using MecaCell::ConnectableCell< Derived, Body >::embedded_plugin_t = typename body_t::embedded_plugin_t |
Definition at line 37 of file connectablecell.hpp.
|
inline |
Definition at line 76 of file connectablecell.hpp.
|
inline |
Definition at line 79 of file connectablecell.hpp.
|
inline |
|
inline |
Constructor.
pos | initial position of the cell's kernel |
Definition at line 94 of file connectablecell.hpp.
|
inline |
Definition at line 96 of file connectablecell.hpp.
|
inline |
Copy constructor with translation.
Useful for division, for example. Shifts the created cell relatively to the copied one.
c | the copied cell |
translation | the vector by which the created cell is translated |
Definition at line 107 of file connectablecell.hpp.
|
inline |
Definition at line 70 of file connectablecell.hpp.
|
inline |
Definition at line 71 of file connectablecell.hpp.
|
inline |
flags the cell as dead so it can be cleanly removed from the world
Definition at line 118 of file connectablecell.hpp.
|
inline |
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.
MecaCell::ConnectableCell< Derived, Body >::EXPORTABLE | ( | ConnectableCell< Derived, Body > | , |
KV(body) | , | ||
KV(id) | |||
) |
|
inline |
Definition at line 152 of file connectablecell.hpp.
|
inline |
Definition at line 154 of file connectablecell.hpp.
|
inline |
Definition at line 155 of file connectablecell.hpp.
|
inline |
Definition at line 159 of file connectablecell.hpp.
|
inline |
Definition at line 153 of file connectablecell.hpp.
|
inline |
Definition at line 75 of file connectablecell.hpp.
|
inline |
Definition at line 163 of file connectablecell.hpp.
|
inline |
Definition at line 120 of file connectablecell.hpp.
|
inline |
Definition at line 162 of file connectablecell.hpp.
|
inline |
Definition at line 72 of file connectablecell.hpp.
|
inline |
Definition at line 119 of file connectablecell.hpp.
|
inlineprotected |
Definition at line 58 of file connectablecell.hpp.
|
inlineprotected |
Definition at line 59 of file connectablecell.hpp.
|
inlineprotected |
Definition at line 57 of file connectablecell.hpp.
|
inline |
Definition at line 128 of file connectablecell.hpp.
|
inline |
Definition at line 129 of file connectablecell.hpp.
|
inline |
Definition at line 122 of file connectablecell.hpp.
|
inline |
Definition at line 127 of file connectablecell.hpp.
|
inline |
Definition at line 126 of file connectablecell.hpp.
|
inline |
should a viewer displpay this cell ?
v |
Definition at line 136 of file connectablecell.hpp.
|
inline |
|
protected |
Definition at line 43 of file connectablecell.hpp.
friend MecaCell::ConnectableCell< Derived, Body >::body_t |
Definition at line 39 of file connectablecell.hpp.
|
protected |
Definition at line 51 of file connectablecell.hpp.
|
protected |
Definition at line 54 of file connectablecell.hpp.
|
protected |
Definition at line 44 of file connectablecell.hpp.
friend MecaCell::ConnectableCell< Derived, Body >::embedded_plugin_t |
Definition at line 40 of file connectablecell.hpp.
size_t MecaCell::ConnectableCell< Derived, Body >::id = 0 |
Definition at line 74 of file connectablecell.hpp.
|
protected |
Definition at line 49 of file connectablecell.hpp.