VTK
vtkOpenGLPolyDataMapper2D.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOpenGLPolyDataMapper2D.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 =========================================================================*/
26 #ifndef vtkOpenGLPolyDataMapper2D_h
27 #define vtkOpenGLPolyDataMapper2D_h
28 
29 #include "vtkRenderingOpenGL2Module.h" // For export macro
30 #include "vtkPolyDataMapper2D.h"
31 #include "vtkOpenGLHelper.h" // used for ivars
32 #include <string> // For API.
33 #include <vector> //for ivars
34 
36 class vtkOpenGLHelper;
38 class vtkPoints;
39 class vtkRenderer;
40 class vtkTextureObject;
41 
42 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLPolyDataMapper2D : public vtkPolyDataMapper2D
43 {
44 public:
47  virtual void PrintSelf(ostream& os, vtkIndent indent);
48 
50  void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor);
51 
56 
57 protected:
60 
61  // the following is all extra stuff to work around the
62  // fact that gl_PrimitiveID does not work correctly on
63  // Apple devices with AMD graphics hardware. See apple
64  // bug ID 20747550
66  std::vector<float> AppleBugPrimIDs;
68 
70 
71  virtual bool GetNeedToRebuildShaders(
72  vtkOpenGLHelper &cellBO, vtkViewport *ren, vtkActor2D *act);
74 
76 
77  virtual void BuildShaders(std::string &VertexCode,
78  std::string &fragmentCode,
79  std::string &geometryCode,
80  vtkViewport *ren, vtkActor2D *act);
82 
84 
85  virtual void UpdateShaders(vtkOpenGLHelper &cellBO,
86  vtkViewport *viewport, vtkActor2D *act);
88 
91  virtual void SetMapperShaderParameters(vtkOpenGLHelper &cellBO, vtkViewport *ren, vtkActor2D *act);
92 
93 
95  void SetCameraShaderParameters(vtkOpenGLHelper &cellBO, vtkViewport *viewport, vtkActor2D *act);
96 
98  void SetPropertyShaderParameters(vtkOpenGLHelper &cellBO, vtkViewport *viewport, vtkActor2D *act);
99 
101  void UpdateVBO(vtkActor2D *act, vtkViewport *viewport);
102 
103  // The VBO and its layout.
105 
106  // Structures for the various cell types we render.
112 
117 
118  vtkTimeStamp VBOUpdateTime; // When was the VBO updated?
120 
121  // do we have wide lines that require special handling
122  virtual bool HaveWideLines(vtkViewport *, vtkActor2D *);
123 
124 private:
125  vtkOpenGLPolyDataMapper2D(const vtkOpenGLPolyDataMapper2D&); // Not implemented.
126  void operator=(const vtkOpenGLPolyDataMapper2D&); // Not implemented.
127 };
128 
129 #endif
static vtkPolyDataMapper2D * New()
virtual void RenderOverlay(vtkViewport *, vtkActor2D *)
Definition: vtkMapper2D.h:40
abstract specification for Viewports
Definition: vtkViewport.h:46
std::vector< float > AppleBugPrimIDs
a actor that draws 2D data
Definition: vtkActor2D.h:44
void PrintSelf(ostream &os, vtkIndent indent)
record modification and/or execution time
Definition: vtkTimeStamp.h:34
abstract specification for renderers
Definition: vtkRenderer.h:63
vtkOpenGLVertexBufferObject * VBO
window superclass for vtkRenderWindow
Definition: vtkWindow.h:36
a simple class to control print indentation
Definition: vtkIndent.h:38
abstracts an OpenGL texture object.
vtkOpenGLBufferObject * AppleBugPrimIDBuffer
virtual void ReleaseGraphicsResources(vtkWindow *)
OpenGL buffer object.
2D PolyData support for OpenGL
draw vtkPolyData onto the image plane
represent and manipulate 3D points
Definition: vtkPoints.h:38
vtkOpenGLBufferObject * CellScalarBuffer