VTK
vtkOpenGLVertexBufferObjectGroup.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkOpenGLTexture.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 =========================================================================*/
30 #ifndef vtkOpenGLVertexBufferObjectGroup_h
31 #define vtkOpenGLVertexBufferObjectGroup_h
32 
33 #include "vtkRenderingOpenGL2Module.h" // For export macro
34 #include "vtkObject.h"
35 #include <map> // for methods
36 #include <vector> // for ivars
37 
38 class vtkDataArray;
42 class vtkShaderProgram;
43 class vtkViewport;
44 class vtkWindow;
45 
46 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLVertexBufferObjectGroup : public vtkObject
47 {
48 public:
51  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
52 
57  int GetNumberOfComponents(const char *attribute);
58 
63  int GetNumberOfTuples(const char *attribute);
64 
70  void ReleaseGraphicsResources(vtkWindow *);
71 
76  vtkOpenGLVertexBufferObject *GetVBO(const char *attribute);
77 
81  void AddAllAttributesToVAO(
82  vtkShaderProgram *program,
84 
90  void CacheDataArray(const char *attribute, vtkDataArray *da,
92  int destType);
93  void CacheDataArray(const char *attribute, vtkDataArray *da,
94  vtkViewport *vp,
95  int destType);
96 
101  void AppendDataArray(const char *attribute, vtkDataArray *da,
102  int destType);
103 
109  void BuildAllVBOs(vtkOpenGLVertexBufferObjectCache *);
110  void BuildAllVBOs(vtkViewport *);
111 
112  void ClearAllDataArrays();
113  void ClearAllVBOs();
114 
115 protected:
118 
119  std::map<std::string, vtkOpenGLVertexBufferObject*> UsedVBOs;
120  std::map<std::string, std::vector<vtkDataArray*> > UsedDataArrays;
121 
122 private:
124  void operator=(const vtkOpenGLVertexBufferObjectGroup&) VTK_DELETE_FUNCTION;
125 
126 };
127 
128 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:53
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
std::map< std::string, vtkOpenGLVertexBufferObject * > UsedVBOs
abstract specification for Viewports
Definition: vtkViewport.h:44
manage vertex buffer objects shared within a context
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
a simple class to control print indentation
Definition: vtkIndent.h:33
The VertexArrayObject class uses, or emulates, vertex array objects.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:48
std::map< std::string, std::vector< vtkDataArray * > > UsedDataArrays
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
manage vertex buffer objects shared within a mapper
The ShaderProgram uses one or more Shader objects.