VTK  9.0.3
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 
42  bool Paint(vtkContext2D* painter) override;
43 
44 protected:
46  ~vtkOpenGLPropItem() override;
47 
48  // Sync the active vtkCamera with the GL state set by the painter.
49  void UpdateTransforms() override;
50 
51  // Restore the vtkCamera state.
52  void ResetTransforms() override;
53 
54 private:
55  vtkNew<vtkCamera> CameraCache;
56  vtkContext2D* Painter;
57 
58  vtkOpenGLPropItem(const vtkOpenGLPropItem&) = delete;
59  void operator=(const vtkOpenGLPropItem&) = delete;
60 };
61 
62 #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:53
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 ResetTransforms() override
~vtkOpenGLPropItem() override
Embed a vtkProp in a vtkContextScene.
Definition: vtkPropItem.h:35