VTK  9.2.6
vtkQWidgetWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4 
5  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
6  All rights reserved.
7  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
30 #ifndef vtkQWidgetWidget_h
31 #define vtkQWidgetWidget_h
32 
33 #include "vtkAbstractWidget.h"
34 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
35 #include "vtkGUISupportQtModule.h" // For export macro
36 #include <QPointF> // for ivar
37 
38 class QWidget;
40 
41 class VTKGUISUPPORTQT_EXPORT vtkQWidgetWidget : public vtkAbstractWidget
42 {
43  friend class vtkInteractionCallback;
44 
45 public:
49  static vtkQWidgetWidget* New();
50 
52 
56  void PrintSelf(ostream& os, vtkIndent indent) override;
58 
64  void SetRepresentation(vtkQWidgetRepresentation* rep);
65 
66  // Description:
67  // Disable/Enable the widget if needed.
68  // Unobserved the camera if the widget is disabled.
69  void SetEnabled(int enabling) override;
70 
74  vtkQWidgetRepresentation* GetQWidgetRepresentation();
75 
79  void CreateDefaultRepresentation() override;
80 
84  void SetWidget(QWidget* w);
85  QWidget* GetWidget() { return this->Widget; }
86 
87 protected:
89  ~vtkQWidgetWidget() override;
90 
91  // Manage the state of the widget
94  {
95  Start = 0,
96  Active
97  };
98 #if !defined(VTK_LEGACY_REMOVE)
99  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
101 #endif
102 
103  QWidget* Widget;
107 
108  // These methods handle events
109  static void SelectAction3D(vtkAbstractWidget*);
110  static void EndSelectAction3D(vtkAbstractWidget*);
111  static void MoveAction3D(vtkAbstractWidget*);
112 
113 private:
114  vtkQWidgetWidget(const vtkQWidgetWidget&) = delete;
115  void operator=(const vtkQWidgetWidget&) = delete;
116 };
117 
118 #endif
#define VTK_DEPRECATED_IN_9_2_0(reason)
void PrintSelf(ostream &os, vtkIndent indent) override
Standard macros implementing standard VTK methods.
3D VTK widget for a QWidget
virtual void CreateDefaultRepresentation()=0
Create the default widget representation if one is not set.
a class defining the representation for a vtkQWidgetWidget
QPointF SteadyWidgetCoordinates
a simple class to control print indentation
Definition: vtkIndent.h:39
QWidget * GetWidget()
define the API for widget / widget representation
void SetEnabled(int) override
Methods for activating this widget.
QPointF LastWidgetCoordinates
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...