VPTissue Reference Manual
Wall.h
Go to the documentation of this file.
1 #ifndef WALL_H_INCLUDED
2 #define WALL_H_INCLUDED
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
22 #include "bio/WallAttributes.h"
24 
25 #include <boost/property_tree/ptree.hpp>
26 #include <iosfwd>
27 #include <tuple>
28 #include <vector>
29 
30 namespace SimPT_Editor {
31  class EditableMesh;
32 }
33 
34 namespace SimPT_Sim {
35 
36 class Cell;
37 class Edge;
38 class NeighborNodes;
39 class Node;
40 
48 class Wall : public WallAttributes
49 {
50 public:
52  virtual ~Wall() {}
53 
55  Cell* GetC1() const { return m_c1; }
56 
58  Cell* GetC2() const { return m_c2; }
59 
61  std::vector<Edge> GetEdges() const;
62 
64  unsigned int GetIndex() const { return m_wall_index; }
65 
67  std::array<double, 3> GetInfluxVector(Cell* c) const;
68 
70  Node* GetN1() const { return m_n1; }
71 
73  Node* GetN2() const { return m_n2; }
74 
76  //double GetWallStrength() const { return m_wall_strength; }
77 
79  std::array<double, 3> GetWallVector(Cell* c) const;
80 
82  double GetLength() const;
83 
89  bool IncludesEdge(const Edge& edge) const;
90 
96  bool IncludesNode(const Node* node) const;
97 
103  bool IsAtBoundary() const;
104 
106  bool IsIntersectingWithDivisionPlane(const std::array<double, 3>& p1,
107  const std::array<double, 3>& p2) const;
108 
110  bool IsSam() const;
111 
113  std::ostream& Print(std::ostream& os) const;
114 
116  virtual void ReadPtree(boost::property_tree::ptree const& wall_pt);
117 
119  void SetC1(Cell* c) { m_c1 = c; }
120 
122  void SetC2(Cell* c) { m_c2 = c; }
123 
125  void SetN1(Node* n) { m_n1 = n; }
126 
128  void SetN2(Node* n) { m_n2 = n; }
129 
131  void SetLengthDirty() const { m_length_dirty = true; }
132 
147  virtual boost::property_tree::ptree ToPtree() const;
148 
149 private:
150  friend class Mesh;
151  template<typename T, size_t N>
153  friend class SimPT_Editor::EditableMesh;
154 
155 private:
156  Wall(unsigned int index, Node* n1, Node* n2, Cell* c1, Cell* c2, unsigned int num_chem);
157  Wall(const Wall& src);
158  Wall& operator=(Wall const&);
159 
160 private:
162  void CalculateLength() const;
163 
164 private:
165  Cell* m_c1;
166  Cell* m_c2;
167  Node* m_n1;
168  Node* m_n2;
169  unsigned int m_wall_index;
170 
171 private:
172  mutable double m_length;
173  mutable bool m_length_dirty;
174 };
175 
176 
177 std::ostream& operator<<(std::ostream& os, const Wall& w);
178 
179 }
180 
181 #endif // end_of_include_guard
bool IsAtBoundary() const
Checks whether a wall is at the boundary of the mesh.
Definition: Wall.cpp:120
A cell contains walls and nodes.
Definition: Cell.h:48
Namespace for SimPT tissue editor package.
Definition: Cell.h:32
bool IncludesNode(const Node *node) const
Checks whether edge is part of this wall.
Definition: Wall.cpp:146
Node in cell wall.
Definition: Node.h:39
bool IncludesEdge(const Edge &edge) const
Checks whether edge is part of this wall.
Definition: Wall.cpp:130
Namespace for the core simulator.
An Edge connects two nodes and is ambidextrous.
Definition: Edge.h:31
void SetLengthDirty() const
Sets the 'dirty bit' i.e. length will recalculated on first use.
Definition: Wall.h:131
Interface for WallAttributes.
Attributes associated with a wall.
virtual boost::property_tree::ptree ToPtree() const
Convert the wall to a ptree.
Definition: Wall.cpp:192
double GetLength() const
Returns (and calculates, if length marked as dirty) the length along all nodes.
Definition: Wall.cpp:97
Interface and implementation for SegmentedVector class.
Structure of cells; key data structure.
Definition: Mesh.h:62
An editable mesh with actions to alter the construction of the mesh.
Definition: EditableMesh.h:35
A cell wall, runs between cell corner points and consists of wall elements.
Definition: Wall.h:48
Container that stores objects "almost contiguously" and guarantees that pointers/iterators are not in...
bool IsSam() const
True if the Wall adheres to the SAM (shoot apical meristem)
Definition: Wall.cpp:125