-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtriangles.h
More file actions
80 lines (54 loc) · 1.97 KB
/
triangles.h
File metadata and controls
80 lines (54 loc) · 1.97 KB
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
#ifndef TRIANGLES_H
#define TRIANGLES_H
#include <QDialog>
#include "ui_triangles.h"
#include <QImage>
#include "abstractscene.h"
#include "abstractfitness.h"
#include <qmath.h>
#include <OpenCLWrapper.h>
/** Main dialog that runs all of the top-level logic and displays progres */
class Triangles : public QDialog
{
Q_OBJECT
public:
Triangles(QWidget *parent = 0, Qt::WindowFlags flags = 0);
~Triangles();
protected:
virtual void resizeEvent( QResizeEvent *e );
private slots:
/// top-level method that runs the whole thing
void run();
/// selects the target image via a file dialog
void selectTarget();
/// resets all values to defaults
void clear();
/// tells the simulation to stop
void stop();
/// sets the correct input frame on radio button selection
void setMethodFrame();
/// sets the correct input frame on radio button selection
void setFitnessFrame();
/// populates the opencl device list when the platform is changed
void populateDeviceList();
private:
/// removes a directory, recursively
static bool removeDir(const QString &dirName);
/// re-renders the current candidate, to show progress
void updateCandidateView();
/// updates all progress variables on the main dialog, and triggers an update of the candidate view
void updateDialog( int iterations, quint64 acceptCount, int improvements, int age, int culture, int maxCultures, int maxIterations, float iterationsPerSec );
/// calculates the fitness for a scene, and stores the fitness value within the scene
static void calculateFitnessForScene( const AbstractFitness *fitness, AbstractScene *scene );
Ui::trianglesClass ui;
QImage m_bestCandidate;
QImage m_currentCandidate;
QImage m_target;
QImage m_targetRender;
QString m_imageFilename;
bool m_running;
float m_bestFitness;
float m_currentFitness;
EmberCLns::OpenCLWrapper m_oclWrapper;
};
#endif // TRIANGLES_H