#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtWidgets/QMainWindow>

/*!
\file
Contains the \ref MainWindow class.
*/

/*!
The main window of the application.
*/
class MainWindow : public QMainWindow
{
	Q_OBJECT

public:
	/*!
	MainWindow constructor. Sets up ui and renderer.
	*/
	explicit MainWindow(QWidget *parent = nullptr);
	~MainWindow();

protected:
	void timerEvent(QTimerEvent* e) override;

private slots:
		void rendererDistanceChanged(float d);
		void on_sigmaSlider_valueChanged(int d);
		void on_sigmaSpinBox_valueChanged(double d);
		void on_zoomSlider_valueChanged(int d);
		void on_sliceSlider_valueChanged(int d);
		void on_sliceSpinBox_valueChanged(double d);
		void on_windowMinSlider_valueChanged(int d);
		void on_windowMinSpinBox_valueChanged(double d);
		void on_windowMaxSlider_valueChanged(int d);
		void on_windowMaxSpinBox_valueChanged(double d);
		void on_orthoCheckbox_toggled(bool v);
		void on_lightDirectionCheckbox_toggled(bool v);
		
		void on_dofCheckBox_toggled(bool v);
		void on_focalPlaneSlider_valueChanged(int d);
		void on_blurAmountSlider_valueChanged(int d);
		void on_blurAmountSpinBox_valueChanged(double d);

		void on_loadVolumeButton_clicked();
		void on_smoothCheckBox_toggled(bool v);

		void initializeError(const QString& error);
private:
	Q_DISABLE_COPY(MainWindow)
	/*!
	Private data reference.
	*/
	class MainWindowPrivate& d;
	void setupRendering();
	void updateVolumeInfo();
	void sliderUpdateSilent(QSlider* s,const int val);
};

#endif // MAINWINDOW_H
