VTK: Rendering/OpenGL2/vtkOpenGLIndexBufferObject.h Source File

| VTK 9.3.1

vtkOpenGLIndexBufferObject.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 #ifndef vtkOpenGLIndexBufferObject_h
4 #define vtkOpenGLIndexBufferObject_h
5
6 #include "vtkOpenGLBufferObject.h"
7 #include "vtkRenderingOpenGL2Module.h" // for export macro
8
16 VTK_ABI_NAMESPACE_BEGIN
17 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLIndexBufferObject : public vtkOpenGLBufferObject
18 {
19 public:
20 static vtkOpenGLIndexBufferObject* New();
21 vtkTypeMacro(vtkOpenGLIndexBufferObject, vtkOpenGLBufferObject);
22 void PrintSelf(ostream& os, vtkIndent indent) override;
23
24 // Sizes/offsets are all in bytes as OpenGL API expects them.
25 size_t IndexCount; // Number of indices in the VBO
26
27 // Description:
28 // used to create an IBO for triangle primitives
29 size_t CreateTriangleIndexBuffer(vtkCellArray* cells, vtkPoints* points,
30 std::vector<unsigned char>* edgeArray, vtkDataArray* edgeFlags);
31
32 // Description:
33 // used to create an IBO for triangle primitives
34 static void AppendTriangleIndexBuffer(std::vector<unsigned int>& indexArray, vtkCellArray* cells,
35 vtkPoints* points, vtkIdType vertexOffset, std::vector<unsigned char>* edgeArray,
36 vtkDataArray* edgeFlags);
37
38 // Description:
39 // create a IBO for wireframe polys/tris
40 size_t CreateTriangleLineIndexBuffer(vtkCellArray* cells);
41
42 // Description:
43 // used to create an IBO for line primitives
44 static void AppendLineIndexBuffer(
45 std::vector<unsigned int>& indexArray, vtkCellArray* cells, vtkIdType vertexOffset);
46
47 // Description:
48 // create a IBO for wireframe polys/tris
49 size_t CreateLineIndexBuffer(vtkCellArray* cells);
50
51 // Description:
52 // create a IBO for wireframe polys/tris
53 static void AppendTriangleLineIndexBuffer(
54 std::vector<unsigned int>& indexArray, vtkCellArray* cells, vtkIdType vertexOffset);
55
56 // Description:
57 // used to create an IBO for primitives as points
58 size_t CreatePointIndexBuffer(vtkCellArray* cells);
59
60 // Description:
61 // used to create an IBO for primitives as points
62 static void AppendPointIndexBuffer(
63 std::vector<unsigned int>& indexArray, vtkCellArray* cells, vtkIdType vertexOffset);
64
65 // Description:
66 // used to create an IBO for line strips and triangle strips
67 size_t CreateStripIndexBuffer(vtkCellArray* cells, bool wireframeTriStrips);
68
69 static void AppendStripIndexBuffer(std::vector<unsigned int>& indexArray, vtkCellArray* cells,
70 vtkIdType vertexOffset, bool wireframeTriStrips);
71
72 // Description:
73 // special index buffer for polys wireframe with edge visibilityflags
74 static void AppendEdgeFlagIndexBuffer(std::vector<unsigned int>& indexArray, vtkCellArray* cells,
75 vtkIdType vertexOffset, vtkDataArray* edgeflags);
76
77 size_t CreateEdgeFlagIndexBuffer(vtkCellArray* cells, vtkDataArray* edgeflags);
78
79 // Description:
80 // used to create an IBO for cell Vertices as points
81 size_t CreateVertexIndexBuffer(vtkCellArray** cells);
82
83 // Description:
84 // used to create an IBO for primitives as points
85 static void AppendVertexIndexBuffer(
86 std::vector<unsigned int>& indexArray, vtkCellArray** cells, vtkIdType vertexOffset);
87
88 protected:
89 vtkOpenGLIndexBufferObject();
90 ~vtkOpenGLIndexBufferObject() override;
91
92 private:
93 vtkOpenGLIndexBufferObject(const vtkOpenGLIndexBufferObject&) = delete;
94 void operator=(const vtkOpenGLIndexBufferObject&) = delete;
95 };
96
97 VTK_ABI_NAMESPACE_END
98 #endif
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:185
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:38
vtkOpenGLBufferObject
OpenGL buffer object.
Definition: vtkOpenGLBufferObject.h:24
vtkOpenGLIndexBufferObject
OpenGL vertex buffer object.
Definition: vtkOpenGLIndexBufferObject.h:18
vtkOpenGLIndexBufferObject::vtkOpenGLIndexBufferObject
vtkOpenGLIndexBufferObject()
vtkOpenGLIndexBufferObject::IndexCount
size_t IndexCount
Definition: vtkOpenGLIndexBufferObject.h:25
vtkOpenGLIndexBufferObject::CreateEdgeFlagIndexBuffer
size_t CreateEdgeFlagIndexBuffer(vtkCellArray *cells, vtkDataArray *edgeflags)
vtkOpenGLIndexBufferObject::AppendEdgeFlagIndexBuffer
static void AppendEdgeFlagIndexBuffer(std::vector< unsigned int > &indexArray, vtkCellArray *cells, vtkIdType vertexOffset, vtkDataArray *edgeflags)
vtkOpenGLIndexBufferObject::AppendTriangleIndexBuffer
static void AppendTriangleIndexBuffer(std::vector< unsigned int > &indexArray, vtkCellArray *cells, vtkPoints *points, vtkIdType vertexOffset, std::vector< unsigned char > *edgeArray, vtkDataArray *edgeFlags)
vtkOpenGLIndexBufferObject::CreateLineIndexBuffer
size_t CreateLineIndexBuffer(vtkCellArray *cells)
vtkOpenGLIndexBufferObject::CreateVertexIndexBuffer
size_t CreateVertexIndexBuffer(vtkCellArray **cells)
vtkOpenGLIndexBufferObject::AppendPointIndexBuffer
static void AppendPointIndexBuffer(std::vector< unsigned int > &indexArray, vtkCellArray *cells, vtkIdType vertexOffset)
vtkOpenGLIndexBufferObject::CreateStripIndexBuffer
size_t CreateStripIndexBuffer(vtkCellArray *cells, bool wireframeTriStrips)
vtkOpenGLIndexBufferObject::AppendStripIndexBuffer
static void AppendStripIndexBuffer(std::vector< unsigned int > &indexArray, vtkCellArray *cells, vtkIdType vertexOffset, bool wireframeTriStrips)
vtkOpenGLIndexBufferObject::CreatePointIndexBuffer
size_t CreatePointIndexBuffer(vtkCellArray *cells)
vtkOpenGLIndexBufferObject::CreateTriangleLineIndexBuffer
size_t CreateTriangleLineIndexBuffer(vtkCellArray *cells)
vtkOpenGLIndexBufferObject::AppendVertexIndexBuffer
static void AppendVertexIndexBuffer(std::vector< unsigned int > &indexArray, vtkCellArray **cells, vtkIdType vertexOffset)
vtkOpenGLIndexBufferObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkOpenGLIndexBufferObject::~vtkOpenGLIndexBufferObject
~vtkOpenGLIndexBufferObject() override
vtkOpenGLIndexBufferObject::New
static vtkOpenGLIndexBufferObject * New()
vtkOpenGLIndexBufferObject::CreateTriangleIndexBuffer
size_t CreateTriangleIndexBuffer(vtkCellArray *cells, vtkPoints *points, std::vector< unsigned char > *edgeArray, vtkDataArray *edgeFlags)
vtkOpenGLIndexBufferObject::AppendTriangleLineIndexBuffer
static void AppendTriangleLineIndexBuffer(std::vector< unsigned int > &indexArray, vtkCellArray *cells, vtkIdType vertexOffset)
vtkOpenGLIndexBufferObject::AppendLineIndexBuffer
static void AppendLineIndexBuffer(std::vector< unsigned int > &indexArray, vtkCellArray *cells, vtkIdType vertexOffset)
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:38
vtkX3D::points
@ points
Definition: vtkX3D.h:446
vtkOpenGLBufferObject.h
vtkIdType
int vtkIdType
Definition: vtkType.h:315