VTK  9.0.1
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:
46  static vtkQWidgetRepresentation* New();
47 
49 
53  void PrintSelf(ostream& os, vtkIndent indent) override;
55 
60  vtkPolyDataAlgorithm* GetPolyDataAlgorithm();
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:
134  ~vtkQWidgetRepresentation() override;
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
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:36
vtkWidgetRepresentation.h
vtkQWidgetRepresentation::_InteractionState
_InteractionState
Definition: vtkQWidgetRepresentation.h:91
vtkQWidgetRepresentation
a class defining the representation for a vtkQWidgetWidget
Definition: vtkQWidgetRepresentation.h:40
vtkQWidgetRepresentation::PlaneTexture
vtkOpenGLTexture * PlaneTexture
Definition: vtkQWidgetRepresentation.h:141
vtkQWidgetRepresentation::QWidgetTexture
vtkQWidgetTexture * QWidgetTexture
Definition: vtkQWidgetRepresentation.h:142
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkQWidgetRepresentation::PlaneMapper
vtkPolyDataMapper * PlaneMapper
Definition: vtkQWidgetRepresentation.h:139
vtkPlaneSource
create an array of quadrilaterals located in a plane
Definition: vtkPlaneSource.h:54
vtkQWidgetRepresentation::Picker
vtkCellPicker * Picker
Definition: vtkQWidgetRepresentation.h:144
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:59
vtkWidgetRepresentation::BuildRepresentation
virtual void BuildRepresentation()=0
vtkQWidgetTexture
Allows a QWidget to be used as a texture in VTK with OpenGL.
Definition: vtkQWidgetTexture.h:34
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
vtkWidgetRepresentation::ComputeComplexInteractionState
virtual int ComputeComplexInteractionState(vtkRenderWindowInteractor *iren, vtkAbstractWidget *widget, unsigned long event, void *callData, int modify=0)
vtkAbstractWidget
define the API for widget / widget representation
Definition: vtkAbstractWidget.h:65
vtkWidgetRepresentation::GetBounds
double * GetBounds() override
Methods to make this class behave as a vtkProp.
Definition: vtkWidgetRepresentation.h:208
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:45
vtkQWidgetRepresentation::PlaneActor
vtkActor * PlaneActor
Definition: vtkQWidgetRepresentation.h:140
vtkQWidgetRepresentation::PlaneSource
vtkPlaneSource * PlaneSource
Definition: vtkQWidgetRepresentation.h:138
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkWidgetRepresentation::RegisterPickers
virtual void RegisterPickers()
Register internal Pickers in the Picking Manager.
vtkRenderWindowInteractor
platform-independent render window interaction including picking and frame rate control.
Definition: vtkRenderWindowInteractor.h:82
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:44
vtkWidgetRepresentation::PlaceWidget
virtual void PlaceWidget(double *vtkNotUsed(bounds[6]))
The following is a suggested API for widget representations.
Definition: vtkWidgetRepresentation.h:134
vtkOpenGLTexture
OpenGL texture map.
Definition: vtkOpenGLTexture.h:33
vtkPropCollection
an ordered list of Props
Definition: vtkPropCollection.h:35
vtkCellPicker
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:66
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkWidgetRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:41