60 lines
1.5 KiB
C++
60 lines
1.5 KiB
C++
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include <QFileDialog>
|
|
#include <QMainWindow>
|
|
#include <OpenMesh/Core/IO/MeshIO.hh>
|
|
#include <OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh>
|
|
|
|
namespace Ui {
|
|
class MainWindow;
|
|
}
|
|
|
|
using namespace OpenMesh;
|
|
using namespace OpenMesh::Attributes;
|
|
|
|
struct MyTraits : public OpenMesh::DefaultTraits
|
|
{
|
|
// use vertex normals and vertex colors
|
|
VertexAttributes( OpenMesh::Attributes::Normal | OpenMesh::Attributes::Color );
|
|
// store the previous halfedge
|
|
HalfedgeAttributes( OpenMesh::Attributes::PrevHalfedge );
|
|
// use face normals face colors
|
|
FaceAttributes( OpenMesh::Attributes::Normal | OpenMesh::Attributes::Color );
|
|
EdgeAttributes( OpenMesh::Attributes::Color );
|
|
// vertex thickness
|
|
VertexTraits{float thickness; float value; Color faceShadingColor;};
|
|
// edge thickness
|
|
EdgeTraits{float thickness;};
|
|
};
|
|
typedef OpenMesh::TriMesh_ArrayKernelT<MyTraits> MyMesh;
|
|
|
|
|
|
enum DisplayMode {Normal, TemperatureMap, ColorShading};
|
|
|
|
class MainWindow : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit MainWindow(QWidget *parent = 0);
|
|
~MainWindow();
|
|
|
|
// la fonction à compléter
|
|
void showParts(MyMesh* _mesh);
|
|
|
|
void displayMesh(MyMesh *_mesh, DisplayMode mode = DisplayMode::Normal);
|
|
void resetAllColorsAndThickness(MyMesh* _mesh);
|
|
|
|
private slots:
|
|
void on_pushButton_chargement_clicked();
|
|
void on_pushButton_clicked();
|
|
|
|
private:
|
|
MyMesh mesh;
|
|
Ui::MainWindow *ui;
|
|
};
|
|
|
|
#endif // MAINWINDOW_H
|