-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathinformation.cpp
231 lines (185 loc) · 4.27 KB
/
information.cpp
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
/****************************************************************************
** Copyright (c) 2016, Adel Kara Slimane <adel.ks@zegrapher.com>
**
** This file is part of ZeGrapher's source code.
**
** ZeGrapher is free software: you may copy, redistribute 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 file 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/>.
**
****************************************************************************/
#include "information.h"
Information::Information()
{
range.Xmax = range.Ymax = 10;
range.Xmin = range.Ymin = -10;
range.Xstep = range.Ystep = 1;
range.XstepMult = range.YstepMult = 1;
gridState = orthonormal = updatingLock = false;
}
void Information::setUnits(Point vec)
{
units = vec;
}
Point Information::getUnits()
{
return units;
}
void Information::emitDataUpdate()
{
emit dataUpdated();
}
void Information::addDataList()
{
data << QList<QPointF>();
DataStyle style;
dataStyle << style;
}
void Information::removeDataList(int index)
{
data.removeAt(index);
dataStyle.removeAt(index);
emit updateOccured();
}
void Information::setDataStyle(int index, DataStyle style)
{
dataStyle[index] = style;
emit dataUpdated();
}
void Information::setData(int index, QList<QPointF> list)
{
data[index] = list;
emit dataUpdated();
}
int Information::getDataListsCount()
{
return data.size();
}
QList<QPointF> Information::getDataList(int index)
{
return data[index];
}
DataStyle Information::getDataStyle(int index)
{
return dataStyle[index];
}
void Information::addDataRegression(Regression *reg)
{
regressions << reg;
emit regressionAdded(reg);
}
void Information::removeDataRegression(Regression *reg)
{
regressions.removeOne(reg);
emit regressionRemoved(reg);
}
QList<Regression*> Information::getRegressions()
{
return regressions;
}
Regression *Information::getRegression(int index)
{
return regressions.at(index);
}
int Information::getRegressionsCount()
{
return regressions.size();
}
void Information::setParEqsListPointer(QList<ParEqWidget*> *list)
{
parEqWidgets = list;
}
QList<ParEqWidget*>* Information::getParEqsList()
{
return parEqWidgets;
}
void Information::emitAnimationUpdate()
{
emit animationUpdate();
}
void Information::setTangentsListPointer(QList<TangentWidget*> *list)
{
tangents = list;
}
QList<TangentWidget*>* Information::getTangentsList()
{
return tangents;
}
void Information::setStraightLinesListPointer(QList<StraightLineWidget*> *list)
{
lines = list;
}
QList<StraightLineWidget*>* Information::getStraightLinesList()
{
return lines;
}
void Information::setSequencesList(QList<SeqCalculator*> list)
{
sequences = list;
}
QList<SeqCalculator*> Information::getSeqsList()
{
return sequences;
}
void Information::setFunctionsList(QList<FuncCalculator*> list)
{
functions = list;
}
QList<FuncCalculator*> Information::getFuncsList()
{
return functions;
}
void Information::setRange(const GraphRange &newWindow)
{
range = newWindow;
emit updateOccured();
}
void Information::setGridState(bool etat)
{
gridState = etat;
emit gridStateChange();
}
void Information::setOrthonormal(bool state)
{
orthonormal = state;
emit newOrthonormalityState(state);
emit updateOccured();
}
void Information::setSettingsVals(SettingsVals opt)
{
parameters = opt;
emit newSettingsVals();
}
void Information::emitUpdateSignal()
{
emit updateOccured();
}
void Information::emitDrawStateUpdate()
{
emit drawStateUpdateOccured();
}
GraphRange Information::getRange()
{
return range;
}
bool Information::getGridState()
{
return gridState;
}
bool Information::isOrthonormal()
{
return orthonormal;
}
SettingsVals Information::getSettingsVals()
{
return parameters;
}