#ifndef MESH_PROCESSING_H
#define MESH_PROCESSING_H

#include "my_mesh.h"
#include "curvature.h"
#include "mesh_viewer.h"
#include <vector>
#include <QObject>


class MeshProcessor : public QObject {
	Q_OBJECT

	Courbures *courbure = nullptr;
	MeshViewer &mesh_viewer;
	bool view_patches = false;
	double implicit_hole_filling_scale;
	double implicit_hole_filling_discr;
	std::vector<MyMesh> fillings;

	void updateView() const;

public:
	MyMesh mesh;
	MyMesh patch;

	MeshProcessor(const QString &path, MeshViewer &mesh_viewer,
				  double implicit_hole_filling_scale,
				  double implicit_hole_filling_discr);
	~MeshProcessor();

public slots:
	void fillHolesDumb();
	void fillHolesImplicit();
	void setImplicitHoleFillingScale(float scale);
	void setImplicitHoleFillingDiscr(float discr);
	void smoothCotangent(double factor);
	void smoothUniform();
	void setPatchView(bool on);
	void click(QVector3D position);
};


#endif