MEDYAN  3.1
Software for simulating active matter dynamics
BranchingPoint.h
Go to the documentation of this file.
1 
2 //------------------------------------------------------------------
3 // **MEDYAN** - Simulation Package for the Mechanochemical
4 // Dynamics of Active Networks, v3.1
5 //
6 // Copyright (2015-2016) Papoian Lab, University of Maryland
7 //
8 // ALL RIGHTS RESERVED
9 //
10 // See the MEDYAN web page for more information:
11 // http://www.medyan.org
12 //------------------------------------------------------------------
13 
14 #ifndef MEDYAN_BranchingPoint_h
15 #define MEDYAN_BranchingPoint_h
16 
17 #include "common.h"
18 
19 #include "MBranchingPoint.h"
20 #include "CBranchingPoint.h"
21 
22 #include "Database.h"
23 #include "Trackable.h"
24 #include "Movable.h"
25 #include "Component.h"
26 
27 //FORWARD DECLARATIONS
28 class Compartment;
29 class Cylinder;
30 
32 
39 class BranchingPoint : public Component, public Trackable, public Movable {
40 
41 private:
42  unique_ptr<MBranchingPoint> _mBranchingPoint;
43  unique_ptr<CBranchingPoint> _cBranchingPoint;
44 
47 
48  double _position;
49 
50  short _branchType;
51 
52  int _branchID;
53 
55  float _birthTime;
56 
58 
60 
62  void updateCoordinate();
63 
64 public:
65  vector<double> coordinate;
66 
69  short branchType, double position = 0.5);
70  virtual ~BranchingPoint() noexcept;
71 
73  Cylinder* getFirstCylinder() {return _c1;}
77 
79  void setCBranchingPoint(CBranchingPoint* cBranchingPoint) {
80  _cBranchingPoint = unique_ptr<CBranchingPoint>(cBranchingPoint);
81  }
83  CBranchingPoint* getCBranchingPoint() {return _cBranchingPoint.get();}
84 
86  MBranchingPoint* getMBranchingPoint() {return _mBranchingPoint.get();}
87 
89  double getPosition() {return _position;}
91  void setPosition(double position) {_position = position;}
93 
95  virtual int getType() {return _branchType;}
97  int getID() {return _branchID;}
99 
102 
104  float getBirthTime() {return _birthTime;}
105 
107  virtual void addToSubSystem() { _branchingPoints.addElement(this);}
109  virtual void removeFromSubSystem() {_branchingPoints.removeElement(this);}
111 
113  static const vector<BranchingPoint*>& getBranchingPoints() {
114  return _branchingPoints.getElements();
115  }
117  static int numBranchingPoints() {
118  return _branchingPoints.countElements();
119  }
120 
123  virtual void updatePosition();
124 
125  virtual void printSelf();
126 
128  static species_copy_t countSpecies(const string& name);
129 };
130 
131 #endif
vector< T > & getElements()
Get all items in database.
Definition: Database.h:69
virtual ~BranchingPoint() noexcept
unsigned int species_copy_t
Species constants.
Definition: common.h:24
virtual void printSelf()
Prints information about this node. Useful for debugging.
CBranchingPoint * getCBranchingPoint()
Get chem branch point.
static const vector< BranchingPoint * > & getBranchingPoints()
Get all instances of this class from the SubSystem.
A container or holding Species and Reactions.
Definition: Compartment.h:49
Cylinder * getFirstCylinder()
Get attached cylinder.
An abstract base class for a movable element in the SubSystem.
Definition: Movable.h:25
A collection class to hold instances of a given class.
Definition: Database.h:38
An abstract base class for a trackable object in the SubSystem.
Definition: Trackable.h:33
Compartment * getCompartment()
Get compartment.
static Database< BranchingPoint * > _branchingPoints
Collection in SubSystem.
virtual size_t countSpecies() const
Return the number of Species contained under this node&#39;s hieararchy.
Definition: Component.h:122
unique_ptr< MBranchingPoint > _mBranchingPoint
Pointer to mech branch point.
void setCBranchingPoint(CBranchingPoint *cBranchingPoint)
Set chem branch point.
int _branchID
Integer ID of this specific branch point, managed by the Database.
Cylinder * getSecondCylinder()
Get attached cylinder.
MBranchingPoint * getMBranchingPoint()
Get mech branch point.
BranchingPoint(Cylinder *c1, Cylinder *c2, short branchType, double position=0.5)
Cylinder * _c2
Branching cylinder.
A class to represent the chemical component of a BranchingPoint.
A container to store a MCylinder and CCylinder.
Definition: Cylinder.h:50
void updateCoordinate()
Helper to get coordinate.
Compartment * _compartment
Where this branch point is.
virtual void updatePosition()
Update the position, inherited from Movable.
float getBirthTime()
Get the birth time.
int getID()
Get branch parameter.
The base class for the Composite pattern hieararchy.
Definition: Component.h:37
void removeElement(T elem)
Remove an element from the collection.
Definition: Database.h:58
Represents the mechanical component of a BranchingPoint.
vector< double > coordinate
coordinate of midpoint, updated with updatePosition()
void setPosition(double position)
Position management.
float _birthTime
Birth time.
int countElements()
Count the number of objects in the collection.
Definition: Database.h:72
unique_ptr< CBranchingPoint > _cBranchingPoint
Pointer to chem branch point.
void addElement(T elem)
Add an element to the collection.
Definition: Database.h:52
virtual void addToSubSystem()
SubSystem management, inherited from Trackable.
static int numBranchingPoints()
Get the number of branching points in this system.
virtual int getType()
Get branch parameter.
double getPosition()
Position management.
Cylinder * _c1
Mother cylinder.
A container to store a MBranchingPoint and CBranchingPoint.
short _branchType
Integer specifying the type.
double _position
Position on mother cylinder.
virtual void removeFromSubSystem()
SubSystem management, inherited from Trackable.