VTK  9.3.1
vtkRenderWidget.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
3 #ifndef vtkRenderWidget_h
4 #define vtkRenderWidget_h
5 
6 #include "vtkNew.h" // For member variables.
7 #include "vtkObject.h"
8 #include "vtkRenderingCoreModule.h" // For export macro
9 #include "vtkVector.h" // For member variables.
10 #include <string> // For member variables.
11 
12 VTK_ABI_NAMESPACE_BEGIN
15 
16 class VTKRENDERINGCORE_EXPORT vtkRenderWidget : public vtkObject
17 {
18 public:
19  vtkTypeMacro(vtkRenderWidget, vtkObject);
20  void PrintSelf(ostream& os, vtkIndent indent) override;
21  static vtkRenderWidget* New();
22 
27  void SetPosition(const vtkVector2i& pos);
28 
33  vtkVector2i GetPosition() const { return this->Position; }
34 
39  void SetSize(const vtkVector2i& size);
40 
46  vtkVector2i GetSize() const { return this->Size; }
47 
52  void SetName(const std::string& name);
53 
58  std::string GetName() const { return this->Name; }
59 
63  virtual void Render();
64 
70  virtual void MakeCurrent();
71 
72  void Initialize();
73  void Start();
74 
75 protected:
77  ~vtkRenderWidget() override;
78 
79  vtkVector2i Position; // Position of the widget in screen coordinates.
80  vtkVector2i Size; // Position of the widget in screen coordinates.
81  std::string Name; // The name of the widget.
82 
85 
86 private:
87  vtkRenderWidget(const vtkRenderWidget&) = delete;
88  void operator=(const vtkRenderWidget&) = delete;
89 };
90 
91 VTK_ABI_NAMESPACE_END
92 #endif
vtkVector2i GetPosition() const
Get the widget position in screen coordinates.
std::string Name
abstract base class for most VTK objects
Definition: vtkObject.h:51
vtkVector2i Position
vtkVector2i Size
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkNew< vtkAbstractInteractionDevice > InteractionDevice
a simple class to control print indentation
Definition: vtkIndent.h:28
Some derived classes for the different vectors commonly used.
Definition: vtkVector.h:440
vtkVector2i GetSize() const
Get the widget size in screen coordinates.
vtkNew< vtkAbstractRenderDevice > RenderDevice
std::string GetName() const
Get the name of the widget.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...