15 #include <vtkAutoInit.h>
17 VTK_MODULE_INIT(vtkRenderingOpenGL2);
18 VTK_MODULE_INIT(vtkInteractionStyle);
32 #include <QVTKOpenGLNativeWidget.h>
33 #include <vtkDataSet.h>
34 #include <vtkLODActor.h>
35 #include <vtkPlanes.h>
36 #include <vtkPolyData.h>
37 #include <vtkRenderWindow.h>
38 #include <vtkSmartPointer.h>
53 class vtkRenderWindowInteractor;
56 class vtkScalarBarWidget;
57 class vtkRenderWindowInteractor;
58 class vtkOrientationMarkerWidget;
59 class VtkWidgetPrivate;
68 bool stereoMode =
false);
73 return this->m_interactor;
78 void setMultiViewports(
bool multi =
true);
79 bool multiViewports()
const;
81 void addActor(vtkProp* actor,
const QColor& clr =
Qt::black);
82 void addViewProp(vtkProp* prop);
83 QList<vtkProp*> actors()
const;
85 void setActorsVisible(
bool visible);
86 void setActorVisible(vtkProp* actor,
bool visible);
87 bool actorVisible(vtkProp* actor);
89 void setBackgroundColor(
const QColor& clr);
90 QColor backgroundColor()
const;
92 vtkRenderer* defaultRenderer();
93 bool defaultRendererTaken()
const;
95 void transformCameraView(
const double* viewMat);
96 void transformCameraProjection(
const double* projMat);
101 return this->setRenderWindow(win);
106 void setBounds(
double* bounds);
120 void setCameraPosition(
const CCVector3d& pos);
121 void setCameraFocalPoint(
const CCVector3d& pos);
133 if (m_scaleBar) m_scaleBar->setVisible(visible);
138 virtual bool event(QEvent* evt)
override;
139 virtual void wheelEvent(QWheelEvent*
event)
override;
140 virtual void keyPressEvent(QKeyEvent*
event)
override;
141 virtual void mouseMoveEvent(QMouseEvent*
event)
override;
142 virtual void mousePressEvent(QMouseEvent*
event)
override;
143 virtual void mouseReleaseEvent(QMouseEvent*
event)
override;
144 virtual void mouseDoubleClickEvent(QMouseEvent*
event)
override;
145 virtual void dragEnterEvent(QDragEnterEvent*
event)
override;
146 virtual void dropEvent(QDropEvent*
event)
override;
148 virtual void updateActivateditems(
149 int x,
int y,
int dx,
int dy,
bool updatePosition =
false);
152 bool m_unclosable =
true;
153 bool m_useVBO =
false;
159 vtkActor* m_modelActor =
nullptr;
160 vtkLODActor* m_filterActor =
nullptr;
187 QTimer* m_wheelZoomUpdateTimer =
nullptr;
constexpr Rgb black(0, 0, 0)
constexpr Rgb red(MAX, 0, 0)
constexpr Rgb blue(0, 0, MAX)
#define QPCL_ENGINE_LIB_API