VTK  9.7.1
vtkContextActor.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
18 #ifndef vtkContextActor_h
19 #define vtkContextActor_h
20 
21 #include "vtkNew.h" // For ivars
22 #include "vtkProp.h"
23 #include "vtkRenderingContext2DModule.h" // For export macro
24 #include "vtkSmartPointer.h" // For ivars
25 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
26 
27 VTK_ABI_NAMESPACE_BEGIN
28 class vtkContext2D;
29 class vtkContext3D;
30 class vtkContextDevice2D;
31 class vtkContextScene;
32 
33 class VTKRENDERINGCONTEXT2D_EXPORT VTK_MARSHALAUTO vtkContextActor : public vtkProp
34 {
35 public:
36  void PrintSelf(ostream& os, vtkIndent indent) override;
37  vtkTypeMacro(vtkContextActor, vtkProp);
38 
39  static vtkContextActor* New();
40 
44  int RenderOverlay(vtkViewport* viewport) override;
45 
47 
51  vtkGetNewMacro(Context, vtkContext2D);
53 
57  vtkContextScene* GetScene();
58 
62  void SetScene(vtkContextScene* scene);
63 
69  void SetForceDevice(vtkContextDevice2D* dev);
70  vtkGetObjectMacro(ForceDevice, vtkContextDevice2D);
78  void ReleaseGraphicsResources(vtkWindow* window) override;
79 
80 protected:
82  ~vtkContextActor() override;
83 
87  virtual void Initialize(vtkViewport* viewport);
88 
90  vtkNew<vtkContext2D> Context;
91  vtkNew<vtkContext3D> Context3D;
92  vtkContextDevice2D* ForceDevice;
93  bool Initialized;
94 
95 private:
96  vtkContextActor(const vtkContextActor&) = delete;
97  void operator=(const vtkContextActor&) = delete;
98 };
99 
100 VTK_ABI_NAMESPACE_END
101 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:49
abstract specification for Viewports
Definition: vtkViewport.h:46
virtual int RenderOverlay(vtkViewport *)
Definition: vtkProp.h:239
Hold a reference to a vtkObjectBase instance.
Definition: vtkMeta.h:23
window superclass for vtkRenderWindow
Definition: vtkWindow.h:41
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:49
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Provides a 2D scene for vtkContextItem objects.
a simple class to control print indentation
Definition: vtkIndent.h:28
Abstract class for drawing 2D primitives.
provides a vtkProp derived object.
#define VTK_MARSHALEXCLUDE(reason)
Allocate and hold a VTK object.
#define VTK_MARSHALAUTO
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
Class for drawing 3D primitives to a graphical context.
Definition: vtkContext3D.h:33
#define VTK_MARSHAL_EXCLUDE_REASON_IS_INTERNAL