-
Notifications
You must be signed in to change notification settings - Fork 3
/
qtvtkitem.h
86 lines (81 loc) · 2.87 KB
/
qtvtkitem.h
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
#ifndef QTVTKITEM_H
#define QTVTKITEM_H
#include <QQuickVTKRenderWindow.h>
#include <QQmlApplicationEngine>
#include <qquickwindow.h>
#include "qquickvtkrenderitem.h"
#include <QQmlContext>
#include <vtkActor.h>
#include <vtkConeSource.h>
#include <vtkPolyDataMapper.h>
#include <QQuickVTKRenderItem.h>
#include <QQuickVTKRenderWindow.h>
#include <QQuickVTKInteractiveWidget.h>
#include <vtkAxesActor.h>
#include <vtkCubeSource.h>
#include <vtkProperty.h>
#include <vtkCaptionActor2D.h>
#include <vtkTextActor.h>
#include <vtkTextProperty.h>
#include <vtkPolyLine.h>
#include <vtkCameraOrientationWidget.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkBoxRepresentation.h>
#include <vtkBoxWidget2.h>
#include <vtkTransform.h>
#include <vtkInteractorStyleTrackballCamera.h>
#include <vtkRenderWindow.h>
#include <vtkCamera.h>
#include <vtkGenericOpenGLRenderWindow.h>
#include <QVTKOpenGLWindow.h>
#include <QQuickVTKRenderItem.h>
#include "vtkinteractorstyletrackballcamerastyle2.h"
#include <QQuickVTKInteractorAdapter.h>
#include "ProcessingEngine.h"
#include "CommandModelAdd.h"
#include <queue>
#include "Model.h"
class MyQQuickVTKRenderItem;
class qtVtkItem:public QObject
{
Q_OBJECT
public:
Q_PROPERTY(bool showFileDialog MEMBER m_showFileDialog NOTIFY showFileDialogChanged)
Q_PROPERTY(bool isModelSelected READ getIsModelSelected WRITE setIsModelSelected NOTIFY isModelSelectedChanged)
bool isModelSelected = false;
bool getIsModelSelected() const;
void setIsModelSelected(bool flag);
Q_INVOKABLE void openModel(const QUrl &path) ;
Q_INVOKABLE void setModelsRepresentation(const int value);
Q_INVOKABLE void setModelsOpacity(const double value);
Q_INVOKABLE void setGouraudInterpolation(const bool value);
Q_INVOKABLE void delSelectedModel();
void setSelectedModel(vtkActor* actor , bool flag);
public:
qtVtkItem(QQmlApplicationEngine* oeigen);
void init() ;
QQmlApplicationEngine* engine ;
vtkSmartPointer<vtkCameraOrientationWidget> camOrientManipulator;
void addCommand(CommandModel* command);
/** Command Queue related function **/
CommandModel* getCommandsQueueFront() const;
void commandsQueuePop();
bool isCommandsQueueEmpty() const;
void lockCommandsQueueMutex();
void unlockCommandsQueueMutex();
signals:
void showFileDialogChanged();
void isModelSelectedChanged();
public slots:
void modelReadyToImport(CommandModel* command);
private:
std::shared_ptr<ProcessingEngine> m_processingEngine;
bool m_showFileDialog = false;
vtkSmartPointer<vtkRenderer> m_otherRenderer;
std::queue<CommandModel*> m_commandsQueue;
std::mutex m_commandsQueueMutex;
MyQQuickVTKRenderItem* m_QQuickvtkrenderItem;
QQuickWindow* qquickWindow;
Model::Ptr m_selectedModel;
};
#endif // QTVTKITEM_H