split viewport for Qt and VtkViewer
This commit is contained in:
76
src/Vtk/vtkViewport.h
Normal file
76
src/Vtk/vtkViewport.h
Normal file
@@ -0,0 +1,76 @@
|
||||
#ifndef ULIB_VTK_VIEWPORT_H
|
||||
#define ULIB_VTK_VIEWPORT_H
|
||||
|
||||
#include "uLibVtkInterface.h"
|
||||
#include <vtkCornerAnnotation.h>
|
||||
#include <vtkOrientationMarkerWidget.h>
|
||||
#include <vtkRenderer.h>
|
||||
#include <vtkSmartPointer.h>
|
||||
#include <vtkVersion.h>
|
||||
|
||||
class vtkAxes;
|
||||
class vtkProp;
|
||||
class vtk3DWidget;
|
||||
class vtkRenderWindow;
|
||||
class vtkRenderWindowInteractor;
|
||||
class vtkCameraOrientationWidget;
|
||||
class vtkPlaneSource;
|
||||
class vtkActor;
|
||||
class vtkNamedColors;
|
||||
class vtkCamera;
|
||||
|
||||
namespace uLib {
|
||||
namespace Vtk {
|
||||
|
||||
/**
|
||||
* @class Viewport
|
||||
* @brief Base class for VTK viewports, providing core rendering and prop management.
|
||||
*/
|
||||
class Viewport {
|
||||
public:
|
||||
Viewport();
|
||||
virtual ~Viewport();
|
||||
|
||||
// Render scene
|
||||
virtual void Render() = 0;
|
||||
void Reset();
|
||||
void ZoomAuto();
|
||||
|
||||
// Puppet / prop management
|
||||
void AddPuppet(Puppet &prop);
|
||||
void RemovePuppet(Puppet &prop);
|
||||
void addProp(vtkProp *prop);
|
||||
void RemoveProp(vtkProp *prop);
|
||||
|
||||
// Widget integration
|
||||
void AddWidget(vtk3DWidget *widget);
|
||||
|
||||
// Direct access to VTK internals
|
||||
vtkRenderer* GetRenderer() { return m_Renderer; }
|
||||
virtual vtkRenderWindow* GetRenderWindow() = 0;
|
||||
virtual vtkRenderWindowInteractor* GetInteractor() = 0;
|
||||
vtkCornerAnnotation* GetAnnotation() { return m_Annotation; }
|
||||
vtkCameraOrientationWidget* GetCameraWidget(){ return m_CameraWidget; }
|
||||
|
||||
protected:
|
||||
void SetupPipeline(vtkRenderWindowInteractor* iren);
|
||||
|
||||
void UpdateGrid();
|
||||
|
||||
vtkRenderer* m_Renderer;
|
||||
vtkCornerAnnotation* m_Annotation;
|
||||
vtkOrientationMarkerWidget* m_Marker;
|
||||
vtkCameraOrientationWidget* m_CameraWidget;
|
||||
|
||||
vtkSmartPointer<vtkPlaneSource> m_GridSource;
|
||||
vtkSmartPointer<vtkActor> m_GridActor;
|
||||
vtkSmartPointer<vtkAxes> m_OriginAxes;
|
||||
vtkSmartPointer<vtkActor> m_OriginAxesActor;
|
||||
|
||||
vtkNamedColors* m_Colors;
|
||||
};
|
||||
|
||||
} // namespace Vtk
|
||||
} // namespace uLib
|
||||
|
||||
#endif // ULIB_VTK_VIEWPORT_H
|
||||
Reference in New Issue
Block a user