VTK  9.2.6
vtkQWidgetRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQWidgetRepresentation.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
25 #ifndef vtkQWidgetRepresentation_h
26 #define vtkQWidgetRepresentation_h
27 
28 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
29 #include "vtkGUISupportQtModule.h" // For export macro
31 
32 class QWidget;
33 class vtkActor;
34 class vtkCellPicker;
35 class vtkOpenGLTexture;
36 class vtkPlaneSource;
38 class vtkPolyDataMapper;
39 class vtkQWidgetTexture;
40 
41 class VTKGUISUPPORTQT_EXPORT vtkQWidgetRepresentation : public vtkWidgetRepresentation
42 {
43 public:
47  static vtkQWidgetRepresentation* New();
48 
50 
54  void PrintSelf(ostream& os, vtkIndent indent) override;
56 
61  vtkPolyDataAlgorithm* GetPolyDataAlgorithm();
62 
67  void UpdatePlacement(void);
68 
70 
73  void PlaceWidget(double bounds[6]) override;
74  void BuildRepresentation() override;
76  unsigned long event, void* calldata, int modify = 0) override;
78 
80 
83  double* GetBounds() VTK_SIZEHINT(6) override;
84  void GetActors(vtkPropCollection* pc) override;
85  void ReleaseGraphicsResources(vtkWindow*) override;
86  int RenderOpaqueGeometry(vtkViewport*) override;
87  int RenderTranslucentPolygonalGeometry(vtkViewport*) override;
88  vtkTypeBool HasTranslucentPolygonalGeometry() override;
90 
91  // Manage the state of the widget
93  {
94  Outside = 0,
95  Inside
96  };
97 #if !defined(VTK_LEGACY_REMOVE)
98  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
100 #endif
101 
103 
112  vtkSetClampMacro(InteractionState, int, Outside, Inside);
114 
118  void SetWidget(QWidget* w);
119 
123  vtkGetObjectMacro(QWidgetTexture, vtkQWidgetTexture);
124 
129  vtkGetObjectMacro(PlaneSource, vtkPlaneSource);
130 
135  vtkGetVector2Macro(WidgetCoordinates, float);
136 
137 protected:
139  ~vtkQWidgetRepresentation() override;
140 
141  float WidgetCoordinates[2];
142 
148 
150 
151  // Register internal Pickers within PickingManager
152  void RegisterPickers() override;
153 
154 private:
156  void operator=(const vtkQWidgetRepresentation&) = delete;
157 };
158 
159 #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:51
virtual void PlaceWidget(double vtkNotUsed(bounds)[6])
The following is a suggested API for widget representations.
abstract specification for Viewports
Definition: vtkViewport.h:55
#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:69
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
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:39
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:72
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...