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
|
#pragma once
#include "../Object3D.h"
#include "../EngineWidget.h"
#include <QImage>
#include "SyntopiaCore/Math/Vector3.h"
#include "SyntopiaCore/Math/Matrix4.h"
#include "SyntopiaCore/Math/Random.h"
#include "VoxelStepper.h"
#include "RenderThread.h"
#include "ProgressiveOutput.h"
namespace SyntopiaCore {
namespace GLEngine {
using namespace SyntopiaCore::Math;
class RayTracer {
public:
RayTracer(EngineWidget* widget, ProgressBox* progressBox, bool inGUI);
QImage calculateImage(int width, int height);
void setParameter(QString param, QString value);
bool wasCancelled() { return userCancelled; }
private:
bool progressiveGUI;
ProgressiveOutput* progressiveOutput;
EngineWidget* engine;
void startJobs(ProgressBox* progress);
QList<Object3D*> objects;
float xmin;
float ymin;
float xmax;
float ymax;
int voxelSteps;
int windowWidth;
int windowHeight;
// Matrices from the OpenGL view.
GLdouble modelView[16];
GLdouble projection[16];
GLint viewPort[16];
long aaPixels;
bool userCancelled;
int sizeX;
int sizeY;
int maxThreads;
QVector<RenderThread*> threads;
AtomicCounter nextUnit;
AtomicCounter completedUnits;
int maxUnits;
RenderThread rt;
bool progressiveRender;
ProgressBox* progressBox;
};
}
}
|