forked from hundlab/LongQt-model
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pvarsgrid.h
56 lines (46 loc) · 1.78 KB
/
pvarsgrid.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef PVARSGRID_H
#define PVARSGRID_H
#include "grid.h"
#include "cellpvars.h"
#include <map>
#include <set>
class PvarsGrid : public CellPvars {
public:
//Types
struct MIonChanParam : CellPvars::IonChanParam {
int maxDist = 0;
double maxVal = 100;
set<pair<int,int>> startCells; //row,col of start cells
map<pair<int,int>,double> cells; //map from row,col -> value
virtual string str(string name) override;
MIonChanParam() = default;
MIonChanParam(const IonChanParam& other): IonChanParam(other) {};
virtual ~MIonChanParam() = default;
};
//Functions
PvarsGrid(Grid* grid);
PvarsGrid(const PvarsGrid&);
virtual ~PvarsGrid() = default;
virtual CellPvars* clone();
void setGrid(Grid* grid);
virtual void setIonChanParams();
virtual void calcIonChanParams();
virtual void writePvars(QXmlStreamWriter& xml);
virtual void readPvars(QXmlStreamReader& xml);
void handlePvars(QXmlStreamReader& xml);
void handlePvar(QXmlStreamReader& xml);
pair<pair<int,int>,double> handleCell(QXmlStreamReader& xml, bool& start);
virtual void insert(string,IonChanParam);
void setMaxDistAndVal(string varname, int maxDist, double maxVal);
void setStartCells(string varname, set<pair<int,int>> startCells);
private:
map<string,MIonChanParam*>* __pvars =
(reinterpret_cast<map<string,MIonChanParam*>*>(&this->pvars));
Grid* grid;
void calcIonChanParam(MIonChanParam* param);
void getNext();
void add(pair<int,int> e, set<pair<int,int>>& next);
set<pair<int,int>> current;
set<pair<int,int>> visited;
};
#endif