VTK  9.2.6
vtkOpenGLIndexBufferObject.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4 
5  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
6  All rights reserved.
7  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
14 #ifndef vtkOpenGLIndexBufferObject_h
15 #define vtkOpenGLIndexBufferObject_h
16 
17 #include "vtkOpenGLBufferObject.h"
18 #include "vtkRenderingOpenGL2Module.h" // for export macro
19 
27 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLIndexBufferObject : public vtkOpenGLBufferObject
28 {
29 public:
32  void PrintSelf(ostream& os, vtkIndent indent) override;
33 
34  // Sizes/offsets are all in bytes as OpenGL API expects them.
35  size_t IndexCount; // Number of indices in the VBO
36 
37  // Description:
38  // used to create an IBO for triangle primitives
39  size_t CreateTriangleIndexBuffer(vtkCellArray* cells, vtkPoints* points,
40  std::vector<unsigned char>* edgeArray, vtkDataArray* edgeFlags);
41 
42  // Description:
43  // used to create an IBO for triangle primitives
44  static void AppendTriangleIndexBuffer(std::vector<unsigned int>& indexArray, vtkCellArray* cells,
45  vtkPoints* points, vtkIdType vertexOffset, std::vector<unsigned char>* edgeArray,
46  vtkDataArray* edgeFlags);
47 
48  // Description:
49  // create a IBO for wireframe polys/tris
50  size_t CreateTriangleLineIndexBuffer(vtkCellArray* cells);
51 
52  // Description:
53  // used to create an IBO for line primitives
54  static void AppendLineIndexBuffer(
55  std::vector<unsigned int>& indexArray, vtkCellArray* cells, vtkIdType vertexOffset);
56 
57  // Description:
58  // create a IBO for wireframe polys/tris
59  size_t CreateLineIndexBuffer(vtkCellArray* cells);
60 
61  // Description:
62  // create a IBO for wireframe polys/tris
63  static void AppendTriangleLineIndexBuffer(
64  std::vector<unsigned int>& indexArray, vtkCellArray* cells, vtkIdType vertexOffset);
65 
66  // Description:
67  // used to create an IBO for primitives as points
68  size_t CreatePointIndexBuffer(vtkCellArray* cells);
69 
70  // Description:
71  // used to create an IBO for primitives as points
72  static void AppendPointIndexBuffer(
73  std::vector<unsigned int>& indexArray, vtkCellArray* cells, vtkIdType vertexOffset);
74 
75  // Description:
76  // used to create an IBO for line strips and triangle strips
77  size_t CreateStripIndexBuffer(vtkCellArray* cells, bool wireframeTriStrips);
78 
79  static void AppendStripIndexBuffer(std::vector<unsigned int>& indexArray, vtkCellArray* cells,
80  vtkIdType vertexOffset, bool wireframeTriStrips);
81 
82  // Description:
83  // special index buffer for polys wireframe with edge visibilityflags
84  static void AppendEdgeFlagIndexBuffer(std::vector<unsigned int>& indexArray, vtkCellArray* cells,
85  vtkIdType vertexOffset, vtkDataArray* edgeflags);
86 
87  size_t CreateEdgeFlagIndexBuffer(vtkCellArray* cells, vtkDataArray* edgeflags);
88 
89  // Description:
90  // used to create an IBO for cell Vertices as points
91  size_t CreateVertexIndexBuffer(vtkCellArray** cells);
92 
93  // Description:
94  // used to create an IBO for primitives as points
95  static void AppendVertexIndexBuffer(
96  std::vector<unsigned int>& indexArray, vtkCellArray** cells, vtkIdType vertexOffset);
97 
98 protected:
100  ~vtkOpenGLIndexBufferObject() override;
101 
102 private:
104  void operator=(const vtkOpenGLIndexBufferObject&) = delete;
105 };
106 
107 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkIdType
Definition: vtkType.h:332
a simple class to control print indentation
Definition: vtkIndent.h:39
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
static vtkOpenGLBufferObject * New()
object to represent cell connectivity
Definition: vtkCellArray.h:186
OpenGL buffer object.
represent and manipulate 3D points
Definition: vtkPoints.h:39
OpenGL vertex buffer object.