-
Notifications
You must be signed in to change notification settings - Fork 1
/
SceneT.hh
92 lines (78 loc) · 2.07 KB
/
SceneT.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#ifndef SCENET_HH
#define SCENET_HH
//#warning "Include Scene.hh"
#include <QGraphicsScene>
#include <QLabel>
#include <QTime>
#include <QtOpenGL>
//#include "ConsoleReader.hh"
#include "zmq.hpp"
#include <string>
#include <iostream>
#ifndef _WIN32
#include <unistd.h>
#else
#include <windows.h>
#endif
#include <OpenMesh/Core/IO/MeshIO.hh>
#include "QtModelT.hh"
#include <OpenMesh/Core/IO/Options.hh>
#include <OpenMesh/Core/Utils/GenProg.hh>
#include <OpenMesh/Core/Utils/color_cast.hh>
#include <OpenMesh/Core/Mesh/Attributes.hh>
#include <string>
//#warning "SceneT.hh included"
using namespace Qt;
template <typename M>
class SceneT : public QGraphicsScene
{
public:
/// default constructor
typedef M MyMesh;
SceneT();
void drawBackground(QPainter *painter, const QRectF &rect);
void drawForeground(QPainter *painter, const QRectF &rect);
public slots:
//void updateText();
void startZMQThread();
protected:
QWidget *saveModelButton;
GLuint PickBuffer[65535];
bool clicked;
private:
QDialog *createDialog(const QString &windowTitle) const;
float m_distance;
float m_vertical;
float m_horizontal;
float radius;
QVector3D m_rotation;
const float TANSLATE_SPEED;
QTime m_time;
int m_mouseEventTime;
QGraphicsRectItem *m_lightItem;
OpenMesh::IO::Options _options;
MyMesh mesh;
QtModelT<M>* model;
void loadModel(std::string filename);
QColor m_backgroundColor;
QGraphicsTextItem *cinTextItem;
QString cinText;
static void zmqThread();
bool firstDraw;
bool hasModel;
void setDefaultMaterial();
void setDefaultLight();
void wheelEvent(QGraphicsSceneWheelEvent * wheelEvent);
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
void keyPressEvent( QKeyEvent* event);
//zmq::context_t context;
//zmq::socket_t *socket;
//ConsoleReader cr;
};
#if !defined(SCENET_CC)
#define SCENET_CC_Templates
# include "SceneT.cc"
#endif
#endif