forked from SpineML/SpineCreator
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathglobalHeader.h
184 lines (155 loc) · 4.7 KB
/
globalHeader.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
/***************************************************************************
** **
** This file is part of SpineCreator, an easy to use, GUI for **
** describing spiking neural network models. **
** Copyright (C) 2013 Alex Cope, Paul Richmond **
** **
** This program is free software: you can redistribute it and/or modify **
** it under the terms of the GNU General Public License as published by **
** the Free Software Foundation, either version 3 of the License, or **
** (at your option) any later version. **
** **
** This program is distributed in the hope that it will be useful, **
** but WITHOUT ANY WARRANTY; without even the implied warranty of **
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the **
** GNU General Public License for more details. **
** **
** You should have received a copy of the GNU General Public License **
** along with this program. If not, see http://www.gnu.org/licenses/. **
** **
****************************************************************************
** Author: Alex Cope **
** Website/Contact: http://bimpa.group.shef.ac.uk/ **
****************************************************************************/
#ifndef GLOBALHEADER_H
#define GLOBALHEADER_H
// prototype all classes;
class viewELLayoutEditHandler;
class viewVZLayoutEditHandler;
class connection;
class csv_connection;
class csv_connectionModel;
class glConnectionWidget;
class GLWidget;
class MainWindow;
class NineMLSortingDialog;
class population;
class projection;
class rootData;
class rootLayout;
class NineMLComponent;
class NineMLComponentData;
class NineMLLayout;
class systemObject;
class valueListDialog;
class BRAHMS_dialog;
class genericInput;
class experiment;
class RootComponentItem;
class synapse;
class systemmodel;
class ParameterData;
class fixedProb_connection;
class distanceBased_connection;
class kernel_connection;
class versionControl;
class projectObject;
using namespace std;
// include headers:
// library
#include <vector>
#include <iostream>
#include <sstream>
// QT
#include <QMainWindow>
#include <QAbstractTableModel>
#include <QString>
#include <QtXml>
#include <QMessageBox>
#include <QtOpenGL>
#include <QObject>
#include <QWidget>
#include <QGraphicsScene>
#include <QGraphicsItem>
#include <QFile>
#include <QColorDialog>
#include <string>
#include "qtimer.h"
#include <QFileDialog>
#include <QtGui>
#include "viewELexptpanelhandler.h"
#include <QHostInfo>
#ifdef _MSC_VER
#include <limits>
#define INFINITY std::numeric_limits<float>::infinity()
#define _USE_MATH_DEFINES
#include "math.h"
#define asinh(x) log(x + sqrt(x*x + 1.0))
#define acosh(x) log(x + sqrt(x*x - 1.0))
#define atanh(x) (log(1.0+x) - log(1.0-x))/2.0
#endif
class versionNumber
{
public:
versionNumber();
versionNumber& operator=(const versionNumber& data);
friend bool operator==(versionNumber& v1, versionNumber& v2);
friend bool operator!=(versionNumber& v1, versionNumber& v2);
friend bool operator>=(versionNumber& v1, versionNumber& v2);
friend bool operator<=(versionNumber& v1, versionNumber& v2);
friend bool operator>(versionNumber& v1, versionNumber& v2);
friend bool operator<(versionNumber& v1, versionNumber& v2);
void setVersion (int maj, int min, int rev, QString owner) {major = maj; minor = min; revision = rev; last_owner = owner;}
int major;
int minor;
int revision;
QString last_owner;
QString toString();
QString toFileString();
void fromFileString(QString);
};
struct loc {
float x;
float y;
float z;
};
struct conn {
uint src;
uint dst;
float metric;
};
enum connectionType {
AlltoAll,
OnetoOne,
FixedProb,
CSV,
DistanceBased,
Kernel,
CSA,
none
};
typedef enum{
FixedValue,
Statistical,
ExplicitList,
Undefined
} ParameterType;
enum drawStyle {
standardDrawStyle,
microcircuitDrawStyle,
layersDrawStyle,
spikeSourceDrawStyle
};
struct trans {
float GLscale;
float viewX;
float viewY;
float width;
float height;
};
const QFont addFont("Helvetica [Cronyx]", 12);
inline double round( double d )
{
return floor( d + 0.5 );
}
#endif // GLOBALHEADER_H