VTK
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 "vtkRenderingOpenGL2Module.h" // for export macro
18 #include "vtkOpenGLBufferObject.h"
19 
20 
30 {
31 public:
34  void PrintSelf(ostream& os, vtkIndent indent);
35 
36  // Sizes/offsets are all in bytes as OpenGL API expects them.
37  size_t IndexCount; // Number of indices in the VBO
38 
39  // Description:
40  // used to create an IBO for triangle primatives
41  size_t CreateTriangleIndexBuffer(vtkCellArray *cells,
42  vtkPoints *points);
43 
44  // Description:
45  // used to create an IBO for triangle primatives
46  static void AppendTriangleIndexBuffer(
47  std::vector<unsigned int> &indexArray,
48  vtkCellArray *cells,
50  vtkIdType vertexOffset);
51 
52  // Description:
53  // create a IBO for wireframe polys/tris
54  size_t CreateTriangleLineIndexBuffer(vtkCellArray *cells);
55 
56  // Description:
57  // used to create an IBO for line primatives
58  static void AppendLineIndexBuffer(
59  std::vector<unsigned int> &indexArray,
60  vtkCellArray *cells,
61  vtkIdType vertexOffset);
62 
63  // Description:
64  // create a IBO for wireframe polys/tris
65  size_t CreateLineIndexBuffer(vtkCellArray *cells);
66 
67  // Description:
68  // create a IBO for wireframe polys/tris
69  static void AppendTriangleLineIndexBuffer(
70  std::vector<unsigned int> &indexArray,
71  vtkCellArray *cells,
72  vtkIdType vertexOffset);
73 
74  // Description:
75  // used to create an IBO for primatives as points
76  size_t CreatePointIndexBuffer(vtkCellArray *cells);
77 
78  // Description:
79  // used to create an IBO for primatives as points
80  static void AppendPointIndexBuffer(
81  std::vector<unsigned int> &indexArray,
82  vtkCellArray *cells,
83  vtkIdType vertexOffset);
84 
85  // Description:
86  // used to create an IBO for line strips and triangle strips
87  size_t CreateStripIndexBuffer(
88  vtkCellArray *cells, bool wireframeTriStrips);
89 
90  // Description:
91  // special index buffer for polys wireframe with edge visibilityflags
92  size_t CreateEdgeFlagIndexBuffer(
93  vtkCellArray *cells, vtkDataArray *edgeflags);
94 
95  // Create supporting arays that are needed when rendering cell data
96  // Some VTK cells have to be broken into smaller cells for OpenGL
97  // When we have cell data we have to map cell attributes from the VTK
98  // cell number to the actual OpenGL cell
99  // The following code fills in
100  //
101  // cellCellMap which maps a openGL cell id to the VTK cell it came from
102  //
103  static void CreateCellSupportArrays(
104  vtkCellArray *[4],
105  std::vector<unsigned int> &cellCellMap,
106  int representation);
107 
108 protected:
111 
112 private:
113  vtkOpenGLIndexBufferObject(const vtkOpenGLIndexBufferObject&); // Not implemented
114  void operator=(const vtkOpenGLIndexBufferObject&); // Not implemented
115 };
116 
117 #endif
#define VTKRENDERINGOPENGL2_EXPORT
void PrintSelf(ostream &os, vtkIndent indent)
int vtkIdType
Definition: vtkType.h:247
a simple class to control print indentation
Definition: vtkIndent.h:38
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:54
static vtkOpenGLBufferObject * New()
object to represent cell connectivity
Definition: vtkCellArray.h:49
OpenGL buffer object.
represent and manipulate 3D points
Definition: vtkPoints.h:38
OpenGL vertex buffer object.