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 
28 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLIndexBufferObject :
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
42  vtkPoints *points);
43 
44  // Description:
45  // used to create an IBO for triangle primatives
47  std::vector<unsigned int> &indexArray,
48  vtkCellArray *cells,
50  vtkIdType vertexOffset);
51 
52  // Description:
53  // create a IBO for wireframe polys/tris
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
66 
67  // Description:
68  // create a IBO for wireframe polys/tris
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
77 
78  // Description:
79  // used to create an IBO for primatives as points
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
88  vtkCellArray *cells, bool wireframeTriStrips);
89 
90  // Description:
91  // special index buffer for polys wireframe with edge visibilityflags
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  //
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
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkOpenGLIndexBufferObject::AppendTriangleLineIndexBuffer
static void AppendTriangleLineIndexBuffer(std::vector< unsigned int > &indexArray, vtkCellArray *cells, vtkIdType vertexOffset)
vtkOpenGLBufferObject
OpenGL buffer object.
Definition: vtkOpenGLBufferObject.h:33
vtkOpenGLIndexBufferObject::CreateStripIndexBuffer
size_t CreateStripIndexBuffer(vtkCellArray *cells, bool wireframeTriStrips)
vtkOpenGLIndexBufferObject::vtkOpenGLIndexBufferObject
vtkOpenGLIndexBufferObject()
vtkOpenGLIndexBufferObject::CreateTriangleIndexBuffer
size_t CreateTriangleIndexBuffer(vtkCellArray *cells, vtkPoints *points)
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkOpenGLIndexBufferObject::CreatePointIndexBuffer
size_t CreatePointIndexBuffer(vtkCellArray *cells)
vtkOpenGLIndexBufferObject::New
static vtkOpenGLIndexBufferObject * New()
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkOpenGLIndexBufferObject::IndexCount
size_t IndexCount
Definition: vtkOpenGLIndexBufferObject.h:37
vtkDataArray
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:55
vtkOpenGLIndexBufferObject::CreateEdgeFlagIndexBuffer
size_t CreateEdgeFlagIndexBuffer(vtkCellArray *cells, vtkDataArray *edgeflags)
vtkgl::points
GLsizei const GLfloat * points
Definition: vtkgl.h:14786
vtkOpenGLIndexBufferObject
OpenGL vertex buffer object.
Definition: vtkOpenGLIndexBufferObject.h:30
vtkOpenGLIndexBufferObject::~vtkOpenGLIndexBufferObject
~vtkOpenGLIndexBufferObject()
vtkOpenGLIndexBufferObject::AppendPointIndexBuffer
static void AppendPointIndexBuffer(std::vector< unsigned int > &indexArray, vtkCellArray *cells, vtkIdType vertexOffset)
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:50
vtkOpenGLIndexBufferObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkOpenGLIndexBufferObject::CreateLineIndexBuffer
size_t CreateLineIndexBuffer(vtkCellArray *cells)
vtkOpenGLIndexBufferObject::CreateTriangleLineIndexBuffer
size_t CreateTriangleLineIndexBuffer(vtkCellArray *cells)
vtkOpenGLBufferObject.h
vtkOpenGLIndexBufferObject::AppendLineIndexBuffer
static void AppendLineIndexBuffer(std::vector< unsigned int > &indexArray, vtkCellArray *cells, vtkIdType vertexOffset)
vtkOpenGLIndexBufferObject::AppendTriangleIndexBuffer
static void AppendTriangleIndexBuffer(std::vector< unsigned int > &indexArray, vtkCellArray *cells, vtkPoints *points, vtkIdType vertexOffset)
vtkOpenGLIndexBufferObject::CreateCellSupportArrays
static void CreateCellSupportArrays(vtkCellArray *[4], std::vector< unsigned int > &cellCellMap, int representation)