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 =========================================================================*/
60 #ifndef vtkOpenGLVertexBufferObjectGroup_h
61 #define vtkOpenGLVertexBufferObjectGroup_h
62 
63 #include "vtkRenderingOpenGL2Module.h" // For export macro
64 #include "vtkObject.h"
65 #include <map> // for methods
66 #include <vector> // for ivars
67 
68 class vtkDataArray;
72 class vtkShaderProgram;
73 class vtkViewport;
74 class vtkWindow;
75 
76 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLVertexBufferObjectGroup : public vtkObject
77 {
78 public:
81  void PrintSelf(ostream& os, vtkIndent indent) override;
82 
87  int GetNumberOfComponents(const char *attribute);
88 
93  int GetNumberOfTuples(const char *attribute);
94 
100  void ReleaseGraphicsResources(vtkWindow *);
101 
106  vtkOpenGLVertexBufferObject *GetVBO(const char *attribute);
107 
111  void AddAllAttributesToVAO(
112  vtkShaderProgram *program,
114 
120  void RemoveAttribute(const char *attribute);
121 
127  void CacheDataArray(const char *attribute, vtkDataArray *da,
129  int destType);
130  void CacheDataArray(const char *attribute, vtkDataArray *da,
131  vtkViewport *vp,
132  int destType);
133 
138  void AppendDataArray(const char *attribute, vtkDataArray *da,
139  int destType);
140 
146  void BuildAllVBOs(vtkOpenGLVertexBufferObjectCache *);
147  void BuildAllVBOs(vtkViewport *);
148 
154  void ClearAllVBOs();
155 
161  void ClearAllDataArrays();
162 
166  vtkMTimeType GetMTime() override;
167 
168 protected:
171 
172  std::map<std::string, vtkOpenGLVertexBufferObject*> UsedVBOs;
173  std::map<std::string, std::vector<vtkDataArray*> > UsedDataArrays;
174 
175 private:
177  void operator=(const vtkOpenGLVertexBufferObjectGroup&) = delete;
178 
179 };
180 
181 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:59
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:300
std::map< std::string, vtkOpenGLVertexBufferObject * > UsedVBOs
abstract specification for Viewports
Definition: vtkViewport.h:47
manage vertex buffer objects shared within a context
window superclass for vtkRenderWindow
Definition: vtkWindow.h:37
a simple class to control print indentation
Definition: vtkIndent.h:39
The VertexArrayObject class uses, or emulates, vertex array objects.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
virtual vtkMTimeType GetMTime()
Return this object's modified time.
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.