MEDYAN  3.1
Software for simulating active matter dynamics
Cylinder.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_Cylinder_h
15 #define MEDYAN_Cylinder_h
16 
17 #include <iostream>
18 
19 #include "common.h"
20 
21 #include "MCylinder.h"
22 #include "CCylinder.h"
23 #include "RateChanger.h"
24 
25 #include "Database.h"
26 #include "Trackable.h"
27 #include "Movable.h"
28 #include "Reactable.h"
29 #include "DynamicNeighbor.h"
30 #include "Component.h"
31 
32 //FORWARD DECLARATIONS
33 class Filament;
34 class Compartment;
35 
37 
50 class Cylinder : public Component, public Trackable, public Movable,
51  public Reactable, public DynamicNeighbor {
52 
53 friend class CController;
54 friend class DRController;
55 
56 private:
57  Bead* _b1;
58  Bead* _b2;
59 
60  unique_ptr<MCylinder> _mCylinder;
61  unique_ptr<CCylinder> _cCylinder;
62 
63  int _position;
64 
65  bool _plusEnd = false;
66  bool _minusEnd = false;
67 
68  short _type;
69 
70  int _ID;
71 
73 
75 
77 
79  static vector<FilamentRateChanger*> _polyChanger;
80 
82 
85  void updateCoordinate();
86 
87 public:
88  vector<double> coordinate;
90 
92  Cylinder(Composite* parent, Bead* b1, Bead* b2, short type, int position,
93  bool extensionFront = false,
94  bool extensionBack = false,
95  bool initialization = false);
96 
97  virtual ~Cylinder() noexcept;
98 
100  MCylinder* getMCylinder() {return _mCylinder.get();}
101 
103  CCylinder* getCCylinder() {return _cCylinder.get();}
106  void setCCylinder(CCylinder* c) {_cCylinder = unique_ptr<CCylinder>(c);}
107 
109  virtual int getType();
110 
112  Bead* getFirstBead() {return _b1;}
114  Bead* getSecondBead() {return _b2;}
116 
118  void setFirstBead(Bead* b) {_b1 = b;}
120  void setSecondBead(Bead* b) {_b2 = b;}
122 
125 
129  void setBranchingCylinder(Cylinder* c) {_branchingCylinder = c;}
131 
133  int getID() {return _ID;}
134 
137  bool isPlusEnd() {return _plusEnd;}
138  void setPlusEnd(bool plusEnd) {_plusEnd = plusEnd;}
139 
140  bool isMinusEnd() {return _minusEnd;}
141  void setMinusEnd(bool minusEnd) {_minusEnd = minusEnd;}
143 
144  int getPosition() {return _position;}
145 
147  virtual void addToSubSystem() { _cylinders.addElement(this);}
149  virtual void removeFromSubSystem() {_cylinders.removeElement(this);}
151 
153  static const vector<Cylinder*>& getCylinders() {
154  return _cylinders.getElements();
155  }
157  static int numCylinders() {
158  return _cylinders.countElements();
159  }
160 
163  virtual void updatePosition();
164 
166  virtual void updateReactionRates();
167 
169  bool isFullLength();
170 
171  virtual void printSelf();
172 
175  virtual bool within(Cylinder* other, double dist);
176 };
177 
178 #endif
unique_ptr< CCylinder > _cCylinder
Pointer to chem cylinder.
Definition: Cylinder.h:61
bool _plusEnd
If the cylinder is at the plus end.
Definition: Cylinder.h:65
vector< T > & getElements()
Get all items in database.
Definition: Database.h:69
void updateCoordinate()
Helper to get coordinate.
Definition: Cylinder.cpp:29
virtual void printSelf()
Prints information about this node. Useful for debugging.
static ChemManager * _chemManager
A pointer to the ChemManager, intiailized by CController.
Definition: Cylinder.h:81
void setMinusEnd(bool minusEnd)
Definition: Cylinder.h:141
static const vector< Cylinder * > & getCylinders()
Get all instances of this class from the SubSystem.
Definition: Cylinder.h:153
Bead * getFirstBead()
Get beads.
Definition: Cylinder.h:113
A container or holding Species and Reactions.
Definition: Compartment.h:49
bool isPlusEnd()
Definition: Cylinder.h:137
For initailizing chemical reactions based on a specific system.
Definition: ChemManager.h:39
short _type
Type of cylinder, either corresponding to Filament or other.
Definition: Cylinder.h:68
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
Cylinder(Composite *parent, Bead *b1, Bead *b2, short type, int position, bool extensionFront=false, bool extensionBack=false, bool initialization=false)
Constructor, initializes a cylinder.
Definition: Cylinder.cpp:35
virtual void updateReactionRates()
Update the reaction rates, inherited from Reactable.
void setSecondBead(Bead *b)
Set beads.
Definition: Cylinder.h:120
virtual void updatePosition()
Update the position, inherited from Movable.
Definition: Cylinder.cpp:87
static int numCylinders()
Get the number of cylinders in this system.
Definition: Cylinder.h:157
A container to store a MCylinder and CCylinder.
Definition: Cylinder.h:50
An abstract base class for a reactable element in the SubSystem.
Definition: Reactable.h:25
unique_ptr< MCylinder > _mCylinder
Pointer to mech cylinder.
Definition: Cylinder.h:60
void setPlusEnd(bool plusEnd)
Definition: Cylinder.h:138
int getID()
Get ID.
Definition: Cylinder.h:133
Used to initialize the dynamic rate components of a simulation.
Definition: DRController.h:30
bool isFullLength()
Check if this cylinder is grown to full length.
virtual void removeFromSubSystem()
SubSystem management, inherited from Trackable.
Definition: Cylinder.h:149
Used to store data about connectivity of Cylinders and Beads.
Definition: Filament.h:46
Used to intialize, control, and run the chemical components of a simulation.
Definition: CController.h:41
void setCCylinder(CCylinder *c)
set chem cylinder
Definition: Cylinder.h:106
vector< double > coordinate
Coordinates of midpoint, updated with updatePosition()
Definition: Cylinder.h:88
virtual void addToSubSystem()
SubSystem management, inherited from Trackable.
Definition: Cylinder.h:148
Used to hold mechanical properties of a Cylinder.
Definition: MCylinder.h:29
Bead * getSecondBead()
Get beads.
Definition: Cylinder.h:114
virtual bool within(Cylinder *other, double dist)
Returns whether a cylinder is within a certain distance from another Uses the closest point between t...
The base class for the Composite pattern hieararchy.
Definition: Component.h:37
Holds all CMonomers and Reactions associated with it.
Definition: CCylinder.h:44
int getPosition()
Definition: Cylinder.h:144
static vector< FilamentRateChanger * > _polyChanger
For dynamic polymerization rate.
Definition: Cylinder.h:79
void removeElement(T elem)
Remove an element from the collection.
Definition: Database.h:58
The aggregating class for the Composite pattern.
Definition: Composite.h:42
Bead * _b2
Pointer to the end bead.
Definition: Cylinder.h:58
int _position
Position on structure.
Definition: Cylinder.h:63
bool _minusEnd
If the cylinder is at the minus end.
Definition: Cylinder.h:66
int _ID
Unique ID of cylinder, managed by Database.
Definition: Cylinder.h:70
virtual ~Cylinder() noexcept
Definition: Cylinder.cpp:77
bool isMinusEnd()
Definition: Cylinder.h:140
Compartment * _compartment
Where this cylinder is.
Definition: Cylinder.h:72
void setFirstBead(Bead *b)
Set beads.
Definition: Cylinder.h:119
int countElements()
Count the number of objects in the collection.
Definition: Database.h:72
virtual int getType()
Get cylinder type.
Definition: Cylinder.cpp:85
Cylinder * getBranchingCylinder()
Branching cylinder management.
Definition: Cylinder.h:128
Compartment * getCompartment()
Get compartment.
Definition: Cylinder.h:124
void addElement(T elem)
Add an element to the collection.
Definition: Database.h:52
CCylinder * getCCylinder()
Get chem cylinder.
Definition: Cylinder.h:103
Cylinder * _branchingCylinder
ptr to a branching cylinder
Definition: Cylinder.h:74
static Database< Cylinder * > _cylinders
Collection in SubSystem.
Definition: Cylinder.h:76
void setBranchingCylinder(Cylinder *c)
Branching cylinder management.
Definition: Cylinder.h:129
Bead * _b1
Pointer to the first bead.
Definition: Cylinder.h:57
An abstract base class for any element that can be added or removed from a NeighborList dynamically a...
Represents a single coordinate between Cylinders, and holds forces needed for mechanical equilibratio...
Definition: Bead.h:49
MCylinder * getMCylinder()
Get mech cylinder.
Definition: Cylinder.h:100