#ifndef MAIN_WINDOW_H
#define MAIN_WINDOW_H

#include "mesh_viewer.h"
#include "my_mesh.h"
#include "double_input.h"

#include <QMainWindow>
#include <QToolBar>
#include <QVBoxLayout>
#include <QDoubleSpinBox>


class MainWindow : public QMainWindow {
	Q_OBJECT

	QToolBar toolbar;
	QAction *open_action;
	QAction *save_action;
	DoubleInput *fill_holes_implicit_scale;
	DoubleInput *fill_holes_implicit_discr;
	DoubleInput *smooth_cotangent_factor_input;
	double smooth_cotangent_factor;

signals:
	void open(const QString &path);
	void save(const QString &path);
	void fillHolesDumbClicked();
	void fillHolesImplicitClicked();
	void fillHolesImplicitScaleChanged(float value);
	void fillHolesImplicitDiscrChanged(float value);
	void smoothUniformClicked();
	void smoothCotangentClicked(double factor);
	void patchViewToggled(bool checked);

public:
	MeshViewer mesh_viewer;

	MainWindow(QWidget *parent=nullptr);
	double fillHolesImplicitScale() const {
		return fill_holes_implicit_scale->value();
	}
	double fillHolesImplicitDiscr() const {
		return fill_holes_implicit_discr->value();
	}
};


#endif
