VTK  9.3.20240418
vtkPropItem.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 
17 #ifndef vtkPropItem_h
18 #define vtkPropItem_h
19 
20 #include "vtkAbstractContextItem.h"
21 #include "vtkRenderingContext2DModule.h" // For export macro
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class vtkProp;
25 
26 class VTKRENDERINGCONTEXT2D_EXPORT vtkPropItem : public vtkAbstractContextItem
27 {
28 public:
29  static vtkPropItem* New();
31  void PrintSelf(ostream& os, vtkIndent indent) override;
32 
33  bool Paint(vtkContext2D* painter) override;
34  void ReleaseGraphicsResources() override;
35 
39  virtual void SetPropObject(vtkProp* PropObject);
40  vtkGetObjectMacro(PropObject, vtkProp);
41 
42 protected:
44  ~vtkPropItem() override;
45 
46  // Sync the active vtkCamera with the GL state set by the painter.
47  virtual void UpdateTransforms();
48 
49  // Restore the vtkCamera state.
50  virtual void ResetTransforms();
51 
52 private:
53  vtkProp* PropObject;
54 
55  vtkPropItem(const vtkPropItem&) = delete;
56  void operator=(const vtkPropItem&) = delete;
57 };
58 
59 VTK_ABI_NAMESPACE_END
60 #endif // vtkPropItem_h
base class for items that are part of a vtkContextScene.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:69
a simple class to control print indentation
Definition: vtkIndent.h:108
Embed a vtkProp in a vtkContextScene.
Definition: vtkPropItem.h:27
static vtkPropItem * New()
bool Paint(vtkContext2D *painter) override
Paint event for the item, called whenever the item needs to be drawn.
virtual void UpdateTransforms()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void SetPropObject(vtkProp *PropObject)
The actor to render.
~vtkPropItem() override
virtual void ResetTransforms()
void ReleaseGraphicsResources() override
Release graphics resources hold by the item.
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:66