VPTissue Reference Manual
WallAttributes.h
Go to the documentation of this file.
1 #ifndef WALL_ATTRIBUTES_H_INCLUDED
2 #define WALL_ATTRIBUTES_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 "WallType.h"
23 
24 #include <iosfwd>
25 #include <string>
26 #include <vector>
27 #include <boost/property_tree/ptree.hpp>
28 
29 namespace SimPT_Sim {
30 
31 class Node;
32 class Cell;
33 class Mesh;
34 
39 {
40 public:
41  WallAttributes(unsigned int num_chem);
42 
43  WallAttributes(double rest_length, double rest_length_init, double strength,
44  const std::vector<double>& transporters1, const std::vector<double>& transporters2,
45  WallType::Type wall_type);
46 
47  virtual ~WallAttributes() {}
48 
49  void CycleWallType();
50 
51  double GetRestLength() const
52  {
53  return m_rest_length;
54  }
55 
56  double GetRestLengthInit() const
57  {
58  return m_rest_length_init;
59  }
60 
61  double GetStrength() const
62  {
63  return m_strength;
64  }
65 
66  std::vector<double> GetTransporters1() const
67  {
68  return m_transporters1;
69  }
70 
71  double GetTransporters1(unsigned int ch) const
72  {
73  return m_transporters1[ch];
74  }
75 
76  std::vector<double> GetTransporters2() const
77  {
78  return m_transporters2;
79  }
80 
81  double GetTransporters2(unsigned int ch) const
82  {
83  return m_transporters2[ch];
84  }
85 
86  WallType::Type GetType() const
87  {
88  return m_wall_type;
89  }
90 
91  bool IsAuxinSource() const
92  {
93  return m_wall_type == WallType::Type::AuxinSource;
94  }
95 
96  bool IsAuxinSink() const { return m_wall_type == WallType::Type::AuxinSink; }
97 
98  virtual void ReadPtree(boost::property_tree::ptree const& wall_pt);
99 
100  void SetRestLength(double l) { m_rest_length = l; }
101 
102  void SetRestLengthInit(double l) { m_rest_length_init = l; }
103 
104  void SetStrength(double strength) { m_strength = strength; }
105 
106  void SetTransporters1(unsigned int ch, double val)
107  {
108  assert( ch < m_transporters1.size() && "Index out of bounds!");
109  m_transporters1[ch] = val;
110  }
111 
112  void SetTransporters1(const std::vector<double>& transporter) { m_transporters1 = transporter; }
113 
114  void SetTransporters2(unsigned int ch, double val)
115  {
116  assert( m_transporters2.size() && "Index out of bounds!");
117  m_transporters2[ch] = val;
118  }
119 
120  void SetTransporters2(const std::vector<double>& transporter)
121  {
122  m_transporters2 = transporter;
123  }
124 
125  void SetType(WallType::Type type)
126  {
127  m_wall_type = type;
128  }
129 
130  void Swap(WallAttributes& src);
131 
146  virtual boost::property_tree::ptree ToPtree() const;
147 
148 protected:
149  double m_rest_length;
150  double m_rest_length_init;
151  double m_strength;
152  std::vector<double> m_transporters1;
153  std::vector<double> m_transporters2;
154  WallType::Type m_wall_type;
155 
156 protected:
157 
158 };
159 
160 }
161 
162 #endif // end_of_include_guard
Type
Enumerates the wall types.
Definition: WallType.h:27
Definition of WallType.
Namespace for the core simulator.
Attributes associated with a wall.
virtual boost::property_tree::ptree ToPtree() const
Convert the wall attributes to a ptree.