VTK  9.1.0
vtkOpenGLPropItem.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOpenGLPropItem.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 
27 #ifndef vtkOpenGLPropItem_h
28 #define vtkOpenGLPropItem_h
29 
30 #include "vtkNew.h" // for vtkNew
31 #include "vtkPropItem.h"
32 #include "vtkRenderingContextOpenGL2Module.h" // For export macro
33 
34 class vtkCamera;
35 
36 class VTKRENDERINGCONTEXTOPENGL2_EXPORT vtkOpenGLPropItem : public vtkPropItem
37 {
38 public:
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
43  bool Paint(vtkContext2D* painter) override;
44 
45 protected:
47  ~vtkOpenGLPropItem() override;
48 
49  // Sync the active vtkCamera with the GL state set by the painter.
50  void UpdateTransforms() override;
51 
52  // Restore the vtkCamera state.
53  void ResetTransforms() override;
54 
55 private:
56  vtkNew<vtkCamera> CameraCache;
57  vtkContext2D* Painter;
58 
59  vtkOpenGLPropItem(const vtkOpenGLPropItem&) = delete;
60  void operator=(const vtkOpenGLPropItem&) = delete;
61 };
62 
63 #endif // vtkOpenGLPropItem_h
a virtual camera for 3D rendering
Definition: vtkCamera.h:46
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:54
a simple class to control print indentation
Definition: vtkIndent.h:34
Sync Context2D state with vtk camera.
void UpdateTransforms() override
bool Paint(vtkContext2D *painter) override
Paint event for the item, called whenever the item needs to be drawn.
static vtkOpenGLPropItem * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ResetTransforms() override
~vtkOpenGLPropItem() override
Embed a vtkProp in a vtkContextScene.
Definition: vtkPropItem.h:35