VTK  9.0.2
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 "vtkGUISupportQtModule.h" // For export macro
30 
31 class QWidget;
32 class vtkActor;
33 class vtkCellPicker;
34 class vtkOpenGLTexture;
35 class vtkPlaneSource;
37 class vtkPolyDataMapper;
38 class vtkQWidgetTexture;
39 
40 class VTKGUISUPPORTQT_EXPORT vtkQWidgetRepresentation : public vtkWidgetRepresentation
41 {
42 public:
47 
49 
53  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
61 
66  void UpdatePlacement(void);
67 
69 
72  void PlaceWidget(double bounds[6]) override;
73  void BuildRepresentation() override;
75  unsigned long event, void* calldata, int modify = 0) override;
77 
79 
82  double* GetBounds() VTK_SIZEHINT(6) override;
83  void GetActors(vtkPropCollection* pc) override;
84  void ReleaseGraphicsResources(vtkWindow*) override;
85  int RenderOpaqueGeometry(vtkViewport*) override;
86  int RenderTranslucentPolygonalGeometry(vtkViewport*) override;
87  vtkTypeBool HasTranslucentPolygonalGeometry() override;
89 
90  // Manage the state of the widget
92  {
93  Outside = 0,
94  Inside
95  };
96 
98 
107  vtkSetClampMacro(InteractionState, int, Outside, Inside);
109 
113  void SetWidget(QWidget* w);
114 
118  vtkGetObjectMacro(QWidgetTexture, vtkQWidgetTexture);
119 
124  vtkGetObjectMacro(PlaneSource, vtkPlaneSource);
125 
130  vtkGetVector2Macro(WidgetCoordinates, int);
131 
132 protected:
135 
136  int WidgetCoordinates[2];
137 
143 
145 
146  // Register internal Pickers within PickingManager
147  void RegisterPickers() override;
148 
149 private:
151  void operator=(const vtkQWidgetRepresentation&) = delete;
152 };
153 
154 #endif
define the API for widget / widget representation
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:46
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:67
a simple class to control print indentation
Definition: vtkIndent.h:34
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
double * GetBounds() override
Methods supporting the rendering process.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetWidget(QWidget *w)
Set the QWidget this representation will render.
void UpdatePlacement(void)
Satisfies the superclass API.
static vtkQWidgetRepresentation * New()
Instantiate the class.
int ComputeComplexInteractionState(vtkRenderWindowInteractor *iren, vtkAbstractWidget *widget, unsigned long event, void *calldata, int modify=0) override
~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:45
abstract class defines interface between the widget and widget representation classes
window superclass for vtkRenderWindow
Definition: vtkWindow.h:38
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_SIZEHINT(...)