VTK  9.3.20240416
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
a simple class to control print indentation
Definition: vtkIndent.h:108
abstract base class for most VTK objects
Definition: vtkObject.h:162
static vtkRenderWidget * New()
vtkVector2i GetSize() const
Get the widget size in screen coordinates.
vtkVector2i Size
void SetPosition(const vtkVector2i &pos)
Set the widget position in screen coordinates.
void SetName(const std::string &name)
Set the name of the widget.
void SetSize(const vtkVector2i &size)
Set the widget size in screen coordinates.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
std::string GetName() const
Get the name of the widget.
virtual void MakeCurrent()
Make the widget's context current, this will defer to the OS specific methods, and calls should be ke...
virtual void Render()
Render everything in the current widget.
vtkVector2i Position
std::string Name
vtkVector2i GetPosition() const
Get the widget position in screen coordinates.
~vtkRenderWidget() override
vtkNew< vtkAbstractInteractionDevice > InteractionDevice
vtkNew< vtkAbstractRenderDevice > RenderDevice
Some derived classes for the different vectors commonly used.
Definition: vtkVector.h:470
@ name
Definition: vtkX3D.h:219
@ size
Definition: vtkX3D.h:253
@ string
Definition: vtkX3D.h:490