-
Notifications
You must be signed in to change notification settings - Fork 0
/
vtkWidget.h
121 lines (95 loc) · 2.74 KB
/
vtkWidget.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#ifndef VTKWIDGET_H
#define VTKWIDGET_H
#include <QtGui>
#include <QVTKWidget.h>
#include <vtkSmartPointer.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkRenderWindow.h>
#include <vtkRenderer.h>
#include <vtkPolyData.h>
#include <vtkImageData.h>
#include <vtkPolyDataMapper.h>
#include <vtkImageTracerWidget.h>
#include <vtkCallbackCommand.h>
#include <vtkImageActor.h>
#include <vtkActor.h>
#include <vtkSphereSource.h>
#include <vtkImageMapper3D.h>
#include <vtkImageCanvasSource2D.h>
#include <vtkInteractorStyleImage.h>
#include <vtkProperty.h>
#include <vtkJPEGReader.h>
#include <vtkWindowToImageFilter.h> // Screenshot
#include <vtkJPEGWriter.h> // Screenshot
#include <vtkInteractorObserver.h>
#include <vtkVertexGlyphFilter.h>
#include <vtkPointData.h>
#include <vtkCellLocator.h>
#include <vtkCamera.h>
#include <vtkImageResize.h>
#include <vtkCleanPolyData.h>
#include <vtkDataSetMapper.h>
#include <vtkDelaunay2D.h>
#include <vtkSelectVisiblePoints.h>
#include <vtkCellPicker.h>
#include <vtkGlyph3D.h>
#include <vtkPoints.h>
#include <vtkIdTypeArray.h>
#include <vtkInteractorStyleTrackballActor.h>
#include <vtkObjectFactory.h>
#include <algorithm>
#include <vtkRendererCollection.h>
#include <vtkExtractSelection.h>
#include <vtkSelection.h>
#include <vtkSelectionNode.h>
#include <vtkInformation.h>
#include <vtkUnstructuredGrid.h>
#include <vtkOBJReader.h>
#include <vtkInteractorStyleTrackballCamera.h>
#include <vtkImageCanvasSource2D.h>
#include <vtkImageBlend.h>
#include <vtkRegularPolygonSource.h>
#include "vtkView.h"
enum OBJECTTYPE{EMPTY=0, IMAGE2D, MODEL3D};
class VtkWidget : public QWidget
{
Q_OBJECT
public:
VtkWidget(VtkView *mvcont);
VtkWidget(QWidget *parent = 0);
~VtkWidget();
VtkView* mvc();
int getId() {return id;}
OBJECTTYPE render(QString filename);
void screenshot(QString file);
void renderUpdate();
private:
void initializeMainWindow();
void copyExistingPointers(VtkView *vcont);
bool read3D(QString filename);
void rendering3D();
bool read2D(QString filename);
void rendering2D();
static void CallbackFunction (vtkObject* caller,
long unsigned int vtkNotUsed(eventId),
void* vtkNotUsed(clientData),
void* vtkNotUsed(callData));
signals:
void selectedSurface(vtkSmartPointer<vtkPolyData> path);
void test();
public:
QVTKWidget* mQVTKWidget;
QVBoxLayout* mLayout;
vtkSmartPointer<vtkRenderer> mRenderer;
vtkImageData* mVtkImageData;
vtkPolyData* mVtkPolyData;
vtkSmartPointer<vtkPolyDataMapper> mMapper;
vtkSmartPointer<vtkActor> mActor;
vtkSmartPointer<vtkImageActor> mActor2D;
vtkSmartPointer<vtkImageTracerWidget> tracer;
vtkSmartPointer<QVTKInteractor> mInteractor;
static VtkWidget *vwidget;
private:
int id;
};
#endif