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 
140  bool ArrayExists(const char *attribute, vtkDataArray *da,
141  vtkIdType& offset,
142  vtkIdType& totalOffset);
143 
148  void AppendDataArray(const char *attribute, vtkDataArray *da, int destType);
149 
155  void BuildAllVBOs(vtkOpenGLVertexBufferObjectCache *);
156  void BuildAllVBOs(vtkViewport *);
157 
163  void ClearAllVBOs();
164 
170  void ClearAllDataArrays();
171 
175  vtkMTimeType GetMTime() override;
176 
177 protected:
180 
181  std::map<std::string, vtkOpenGLVertexBufferObject*> UsedVBOs;
182  std::map<std::string, std::vector<vtkDataArray*> > UsedDataArrays;
183  std::map<std::string, std::map<vtkDataArray*, vtkIdType> > UsedDataArrayMaps;
184  std::map<std::string, vtkIdType> UsedDataArraySizes;
185 
186 private:
188  void operator=(const vtkOpenGLVertexBufferObjectGroup&) = delete;
189 
190 };
191 
192 #endif
std::map< std::string, vtkIdType > UsedDataArraySizes
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:302
std::map< std::string, vtkOpenGLVertexBufferObject * > UsedVBOs
abstract specification for Viewports
Definition: vtkViewport.h:47
manage vertex buffer objects shared within a context
int vtkIdType
Definition: vtkType.h:347
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.
std::map< std::string, std::map< vtkDataArray *, vtkIdType > > UsedDataArrayMaps
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
virtual vtkMTimeType GetMTime()
Return this object&#39;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.