VTK
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 
26 #ifndef vtkOpenGLPropItem_h
27 #define vtkOpenGLPropItem_h
28 
29 #include "vtkRenderingContextOpenGL2Module.h" // For export macro
30 #include "vtkPropItem.h"
31 #include "vtkNew.h" // for vtkNew
32 
33 class vtkCamera;
34 
36 {
37 public:
38  static vtkOpenGLPropItem *New();
40 
41  virtual bool Paint(vtkContext2D *painter);
42 
43 protected:
45  ~vtkOpenGLPropItem();
46 
47  // Sync the active vtkCamera with the GL state set by the painter.
48  virtual void UpdateTransforms();
49 
50  // Restore the vtkCamera state.
51  virtual void ResetTransforms();
52 
53 private:
54  vtkNew<vtkCamera> CameraCache;
55  vtkContext2D *Painter;
56 
57  vtkOpenGLPropItem(const vtkOpenGLPropItem &); // Not implemented.
58  void operator=(const vtkOpenGLPropItem &); // Not implemented.
59 };
60 
61 #endif //vtkOpenGLPropItem_h
Sync Context2D state with vtk camera.
Embed a vtkProp in a vtkContextScene.
Definition: vtkPropItem.h:36
static vtkPropItem * New()
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:56
a virtual camera for 3D rendering
Definition: vtkCamera.h:49
#define VTKRENDERINGCONTEXTOPENGL2_EXPORT
Allocate and hold a VTK object.
Definition: vtkNew.h:66