VTK  9.3.20240328
vtkQWidgetRepresentation.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
13 #ifndef vtkQWidgetRepresentation_h
14 #define vtkQWidgetRepresentation_h
15 
16 #include "vtkGUISupportQtModule.h" // For export macro
18 
19 class QWidget;
20 
21 VTK_ABI_NAMESPACE_BEGIN
22 class vtkActor;
23 class vtkCellPicker;
24 class vtkOpenGLTexture;
25 class vtkPlaneSource;
27 class vtkPolyDataMapper;
28 class vtkQWidgetTexture;
29 
30 class VTKGUISUPPORTQT_EXPORT vtkQWidgetRepresentation : public vtkWidgetRepresentation
31 {
32 public:
37 
39 
43  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
51 
57 
59 
62  void PlaceWidget(double bounds[6]) override;
63  void BuildRepresentation() override;
65  unsigned long event, void* calldata, int modify = 0) override;
67 
69 
72  double* GetBounds() VTK_SIZEHINT(6) override;
73  void GetActors(vtkPropCollection* pc) override;
74  void ReleaseGraphicsResources(vtkWindow*) override;
75  int RenderOpaqueGeometry(vtkViewport*) override;
76  int RenderTranslucentPolygonalGeometry(vtkViewport*) override;
77  vtkTypeBool HasTranslucentPolygonalGeometry() override;
79 
80  // Manage the state of the widget
82  {
83  Outside = 0,
84  Inside
85  };
86 
88 
97  vtkSetClampMacro(InteractionState, int, Outside, Inside);
99 
103  void SetWidget(QWidget* w);
104 
108  vtkGetObjectMacro(QWidgetTexture, vtkQWidgetTexture);
109 
114  vtkGetObjectMacro(PlaneSource, vtkPlaneSource);
115 
120  vtkGetVector2Macro(WidgetCoordinates, float);
121 
122 protected:
125 
126  float WidgetCoordinates[2];
127 
133 
135 
136  // Register internal Pickers within PickingManager
137  void RegisterPickers() override;
138 
139 private:
141  void operator=(const vtkQWidgetRepresentation&) = delete;
142 };
143 
144 VTK_ABI_NAMESPACE_END
145 #endif
define the API for widget / widget representation
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:150
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:91
a simple class to control print indentation
Definition: vtkIndent.h:108
OpenGL texture map.
create an array of quadrilaterals located in a plane
Superclass for algorithms that produce only polydata as output.
map vtkPolyData to graphics primitives
an ordered list of Props
a class defining the representation for a vtkQWidgetWidget
void PlaceWidget(double bounds[6]) override
Methods to interface with the vtkImplicitPlaneWidget2.
void RegisterPickers() override
Register internal Pickers in the Picking Manager.
void BuildRepresentation() override
Methods to interface with the vtkImplicitPlaneWidget2.
double * GetBounds() override
Methods supporting the rendering process.
void UpdatePlacement()
Satisfies the superclass API.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for the class.
void SetWidget(QWidget *w)
Set the QWidget this representation will render.
static vtkQWidgetRepresentation * New()
Instantiate the class.
int ComputeComplexInteractionState(vtkRenderWindowInteractor *iren, vtkAbstractWidget *widget, unsigned long event, void *calldata, int modify=0) override
Methods to interface with the vtkImplicitPlaneWidget2.
~vtkQWidgetRepresentation() override
vtkPolyDataAlgorithm * GetPolyDataAlgorithm()
Satisfies superclass API.
Allows a QWidget to be used as a texture in VTK with OpenGL.
platform-independent render window interaction including picking and frame rate control.
abstract specification for Viewports
Definition: vtkViewport.h:64
abstract class defines interface between the widget and widget representation classes
window superclass for vtkRenderWindow
Definition: vtkWindow.h:47
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_SIZEHINT(...)