VTK  9.7.1
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:
36  static vtkQWidgetRepresentation* New();
37 
39 
43  void PrintSelf(ostream& os, vtkIndent indent) override;
45 
50  vtkPolyDataAlgorithm* GetPolyDataAlgorithm();
51 
56  void UpdatePlacement();
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:
124  ~vtkQWidgetRepresentation() override;
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
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:41
virtual void PlaceWidget(double bounds[6])
The following is a suggested API for widget representations.
abstract specification for Viewports
Definition: vtkViewport.h:46
virtual int ComputeComplexInteractionState(vtkRenderWindowInteractor *iren, vtkAbstractWidget *widget, unsigned long event, void *callData, int modify=0)
abstract class defines interface between the widget and widget representation classes ...
a class defining the representation for a vtkQWidgetWidget
virtual void BuildRepresentation()=0
Subclasses of vtkWidgetRepresentation must implement these methods.
double * GetBounds() override
Methods to make this class behave as a vtkProp.
an ordered list of Props
OpenGL texture map.
int vtkTypeBool
Definition: vtkABI.h:64
window superclass for vtkRenderWindow
Definition: vtkWindow.h:41
platform-independent render window interaction including picking and frame rate control.
Superclass for algorithms that produce only polydata as output.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void RegisterPickers()
Register internal Pickers in the Picking Manager.
#define VTK_SIZEHINT(...)
create an array of quadrilaterals located in a plane
define the API for widget / widget representation
map vtkPolyData to graphics primitives
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:62
Allows a QWidget to be used as a texture in VTK with OpenGL.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...