VTK  9.0.1
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 
41  // Description:
42  // used to create an IBO for triangle primitives
43  static void AppendTriangleIndexBuffer(std::vector<unsigned int>& indexArray, vtkCellArray* cells,
44  vtkPoints* points, vtkIdType vertexOffset);
45 
46  // Description:
47  // create a IBO for wireframe polys/tris
48  size_t CreateTriangleLineIndexBuffer(vtkCellArray* cells);
49 
50  // Description:
51  // used to create an IBO for line primitives
52  static void AppendLineIndexBuffer(
53  std::vector<unsigned int>& indexArray, vtkCellArray* cells, vtkIdType vertexOffset);
54 
55  // Description:
56  // create a IBO for wireframe polys/tris
57  size_t CreateLineIndexBuffer(vtkCellArray* cells);
58 
59  // Description:
60  // create a IBO for wireframe polys/tris
61  static void AppendTriangleLineIndexBuffer(
62  std::vector<unsigned int>& indexArray, vtkCellArray* cells, vtkIdType vertexOffset);
63 
64  // Description:
65  // used to create an IBO for primitives as points
66  size_t CreatePointIndexBuffer(vtkCellArray* cells);
67 
68  // Description:
69  // used to create an IBO for primitives as points
70  static void AppendPointIndexBuffer(
71  std::vector<unsigned int>& indexArray, vtkCellArray* cells, vtkIdType vertexOffset);
72 
73  // Description:
74  // used to create an IBO for line strips and triangle strips
75  size_t CreateStripIndexBuffer(vtkCellArray* cells, bool wireframeTriStrips);
76 
77  static void AppendStripIndexBuffer(std::vector<unsigned int>& indexArray, vtkCellArray* cells,
78  vtkIdType vertexOffset, bool wireframeTriStrips);
79 
80  // Description:
81  // special index buffer for polys wireframe with edge visibilityflags
82  static void AppendEdgeFlagIndexBuffer(std::vector<unsigned int>& indexArray, vtkCellArray* cells,
83  vtkIdType vertexOffset, vtkDataArray* edgeflags);
84 
85  size_t CreateEdgeFlagIndexBuffer(vtkCellArray* cells, vtkDataArray* edgeflags);
86 
87  // Description:
88  // used to create an IBO for cell Vertices as points
89  size_t CreateVertexIndexBuffer(vtkCellArray** cells);
90 
91  // Description:
92  // used to create an IBO for primitives as points
93  static void AppendVertexIndexBuffer(
94  std::vector<unsigned int>& indexArray, vtkCellArray** cells, vtkIdType vertexOffset);
95 
96 protected:
98  ~vtkOpenGLIndexBufferObject() override;
99 
100 private:
102  void operator=(const vtkOpenGLIndexBufferObject&) = delete;
103 };
104 
105 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkOpenGLBufferObject::New
static vtkOpenGLBufferObject * New()
vtkOpenGLBufferObject
OpenGL buffer object.
Definition: vtkOpenGLBufferObject.h:33
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkOpenGLIndexBufferObject::IndexCount
size_t IndexCount
Definition: vtkOpenGLIndexBufferObject.h:35
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:49
vtkOpenGLIndexBufferObject
OpenGL vertex buffer object.
Definition: vtkOpenGLIndexBufferObject.h:27
vtkX3D::points
@ points
Definition: vtkX3D.h:452
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:179
vtkOpenGLBufferObject.h
vtkOpenGLBufferObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.