-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathQtModelT.hh
55 lines (45 loc) · 1.02 KB
/
QtModelT.hh
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
#ifndef MODEL_HH
#define MODEL_HH
#include <iostream>
#include <fstream>
#include <QString>
#include <QVector>
#include <QPainter>
#include <QGraphicsItem>
#include "Scene.hh"
#include "MyMesh.hh"
#include <QVector3D>
#include <eigen3/Eigen/Dense>
#include <nanoflann.hpp>
//#include <flann/io/hdf5.h>
//#warning "QtModelT.hh included"
using namespace Qt;
using namespace OpenMesh;
using namespace Eigen;
template <typename M>
class QtModelT : public QGraphicsItem
{
public:
typedef M MyMesh;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
QRectF boundingRect() const;
public:
M mesh;
QtModelT(M& m);
~QtModelT();
void render();
void select(int faceNumber);
private:
QVector3D modelRotation;
QColor modelColor;
GLfloat vertical;
GLfloat horizontal;
GLfloat depth;
const float deg2Rad;
void calcNormals();
};
#if defined(OM_INCLUDE_TEMPLATES) && !defined(MODEL_CC)
# define SCENE_TEMPLATES
# include "QtModelT.cc"
#endif
#endif