1 #ifndef CELL_H_INCLUDED
2 #define CELL_H_INCLUDED
26 #include <boost/property_tree/ptree.hpp>
38 using boost::property_tree::ptree;
55 void AddWall(
Wall* w);
79 const std::vector<Node*>&
GetNodes()
const {
return m_nodes; }
82 std::vector<Node*>&
GetNodes() {
return m_nodes; }
88 const std::list<Wall*>&
GetWalls()
const {
return m_walls; }
91 std::list<Wall*>&
GetWalls() {
return m_walls; }
94 bool HasEdge(
const Edge& edge)
const;
97 bool HasBoundaryWall()
const;
100 bool HasNeighborOfTypeZero()
const;
103 bool IsBoundaryPolygon()
const {
return m_index == -1; }
112 void Move(
const std::array<double, 3>& a);
118 virtual std::ostream& Print(std::ostream& os)
const;
121 virtual void ReadPtree(
const ptree& cell_pt);
124 void ReassignWall(Wall* w, Cell* to);
130 void SetTransporters(
unsigned int chem,
double conc);
133 void SetTransporters(
unsigned int chem,
double conc,
double lat);
136 void SetTransportersLight(
unsigned int chem,
double conc,
double lat);
144 template<
typename T,
size_t N>
149 Cell(
int index,
unsigned int chem_count);
150 Cell(
const Cell& src) =
delete;
151 Cell& operator=(
const Cell& src) =
delete;
155 void CalculateArea()
const;
158 void CalculateCentroid()
const;
161 void CalculateGeoData()
const;
165 std::vector<Node*> m_nodes;
166 std::list<Wall*> m_walls;
169 mutable bool m_dirty_area;
170 mutable bool m_dirty_centroid;
171 mutable bool m_dirty_geo_data;
172 mutable GeoData m_geo_data;
175 std::ostream& operator<<(std::ostream& os, Cell
const& v);
179 #endif // end_of_include_guard
std::list< Wall * > & GetWalls()
Access the cell's walls.
A cell contains walls and nodes.
Namespace for SimPT tissue editor package.
std::vector< Node * > & GetNodes()
Access the nodes of cell's polygon.
Plain data structure with cell geometric data (such as area).
const std::list< Wall * > & GetWalls() const
Access the cell's walls.
Interface/Implementation for GeoData.
Namespace for the core simulator.
An Edge connects two nodes and is ambidextrous.
double GetCircumference() const
Return the circumference along the edges.
ptree GeometryToPtree() const
Convert the cell geometry to a ptree.
const std::vector< Node * > & GetNodes() const
Access the nodes of cell's polygon.
bool IsWallNeighbor(Cell *cell) const
Strict neighbor (you're never your own neighbor)
double GetSignedArea() const
Return the signed area of the cell.
int GetIndex() const
Return the index.
std::array< double, 3 > GetCentroid() const
Return the centroid position.
Interface and implementation for SegmentedVector class.
virtual ptree ToPtree() const
Convert the cell (geometry and attributes) to a ptree.
GeoData GetGeoData() const
Return GeData (area, centroid, area moment of inertia).
Interface for CellAttributes.
double GetSumTransporters(unsigned int ch) const
Sum transporters at this cell's side of the walls.
void Move(const std::array< double, 3 > &a)
Strict neighbor (you're never your own neighbor)
An editable mesh with actions to alter the construction of the mesh.
bool MoveSelfIntersects(Node *moving_node, std::array< double, 3 > new_pos)
Check for self-intersection when moving_node gets displaced.
double GetArea() const
Return the area of the cell.
A cell wall, runs between cell corner points and consists of wall elements.
Container that stores objects "almost contiguously" and guarantees that pointers/iterators are not in...