-
Notifications
You must be signed in to change notification settings - Fork 0
/
QChaosModel.hh
58 lines (41 loc) · 1.32 KB
/
QChaosModel.hh
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
#ifndef QChaosModel_h
#define QChaosModel_h
#include <stdlib.h>
#include <math.h>
// abstract base class for a dynamic system model
#include <iostream>
#include <string>
#include <QObject>
class QChaosModel : public QObject {
Q_OBJECT
public:
QChaosModel( std::string nm, int n );
virtual ~QChaosModel( );
double getParameter( int idx );
const char* getName(){ return name.c_str(); }
int getNPars(){ return npars; }
double* getPars(){ return par; }
const QString getInfo() { return info; }
// Pure virtual fuction that returns the next point in the
// model, keeps track internally of the iteration, returns
// 0 if all is fine, 1 if max iterations reached or problem...
virtual int iterate( double *xp, double *yp ) = 0;
// pure virtual function to reset the model, iter = 0 and
// set x and y to initial conditions
virtual void init( void ) = 0;
// pure virtual function to reset the model, iter = 0 and
// set x and y to initial conditions
virtual void startpos( void ) = 0;
public slots:
void setParameter( int idx, double value );
signals:
void parameterChanged( int idx, double value );
protected:
std::string name;
QString info;
double x;
double y;
double *par;
int npars;
};
#endif /* #ifndef QChaosModel_h */