VTK  9.3.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 "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
17 #include "vtkGUISupportQtModule.h" // For export macro
19 
20 class QWidget;
21 
22 VTK_ABI_NAMESPACE_BEGIN
23 class vtkActor;
24 class vtkCellPicker;
25 class vtkOpenGLTexture;
26 class vtkPlaneSource;
28 class vtkPolyDataMapper;
29 class vtkQWidgetTexture;
30 
31 class VTKGUISUPPORTQT_EXPORT vtkQWidgetRepresentation : public vtkWidgetRepresentation
32 {
33 public:
37  static vtkQWidgetRepresentation* New();
38 
40 
44  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
51  vtkPolyDataAlgorithm* GetPolyDataAlgorithm();
52 
57  void UpdatePlacement();
58 
60 
63  void PlaceWidget(double bounds[6]) override;
64  void BuildRepresentation() override;
66  unsigned long event, void* calldata, int modify = 0) override;
68 
70 
73  double* GetBounds() VTK_SIZEHINT(6) override;
74  void GetActors(vtkPropCollection* pc) override;
75  void ReleaseGraphicsResources(vtkWindow*) override;
76  int RenderOpaqueGeometry(vtkViewport*) override;
77  int RenderTranslucentPolygonalGeometry(vtkViewport*) override;
78  vtkTypeBool HasTranslucentPolygonalGeometry() override;
80 
81  // Manage the state of the widget
83  {
84  Outside = 0,
85  Inside
86  };
87 #if !defined(VTK_LEGACY_REMOVE)
88  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
90 #endif
91 
93 
102  vtkSetClampMacro(InteractionState, int, Outside, Inside);
104 
108  void SetWidget(QWidget* w);
109 
113  vtkGetObjectMacro(QWidgetTexture, vtkQWidgetTexture);
114 
119  vtkGetObjectMacro(PlaneSource, vtkPlaneSource);
120 
125  vtkGetVector2Macro(WidgetCoordinates, float);
126 
127 protected:
129  ~vtkQWidgetRepresentation() override;
130 
131  float WidgetCoordinates[2];
132 
138 
140 
141  // Register internal Pickers within PickingManager
142  void RegisterPickers() override;
143 
144 private:
146  void operator=(const vtkQWidgetRepresentation&) = delete;
147 };
148 
149 VTK_ABI_NAMESPACE_END
150 #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:40
virtual void PlaceWidget(double vtkNotUsed(bounds)[6])
The following is a suggested API for widget representations.
abstract specification for Viewports
Definition: vtkViewport.h:44
#define VTK_DEPRECATED_IN_9_2_0(reason)
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:27
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:61
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...