VTK  9.0.1
vtkImageItem.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImageItem.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 
25 #ifndef vtkImageItem_h
26 #define vtkImageItem_h
27 
28 #include "vtkContextItem.h"
29 #include "vtkRenderingContext2DModule.h" // For export macro
30 #include "vtkSmartPointer.h" // For SP ivars.
31 
32 class vtkImageData;
33 
34 class VTKRENDERINGCONTEXT2D_EXPORT vtkImageItem : public vtkContextItem
35 {
36 public:
37  vtkTypeMacro(vtkImageItem, vtkContextItem);
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
40  static vtkImageItem* New();
41 
45  bool Paint(vtkContext2D* painter) override;
46 
50  void SetImage(vtkImageData* image);
51 
53 
56  vtkGetObjectMacro(Image, vtkImageData);
58 
60 
63  vtkSetVector2Macro(Position, float);
65 
67 
70  vtkGetVector2Macro(Position, float);
72 
73 protected:
74  vtkImageItem();
75  ~vtkImageItem() override;
76 
77  float Position[2];
78 
80 
81 private:
82  vtkImageItem(const vtkImageItem&) = delete;
83  void operator=(const vtkImageItem&) = delete;
84 };
85 
86 #endif // vtkImageItem_h
a vtkContextItem that draws a supplied image in the scene.
Definition: vtkImageItem.h:34
base class for items that are part of a vtkContextScene.
virtual bool Paint(vtkContext2D *painter)
Paint event for the item, called whenever the item needs to be drawn.
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:52
a simple class to control print indentation
Definition: vtkIndent.h:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:41
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkImageData * Image
Definition: vtkImageItem.h:79