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 
91  std::vector<unsigned int> &indexArray,
92  vtkCellArray *cells,
93  vtkIdType vertexOffset, bool wireframeTriStrips);
94 
95  // Description:
96  // special index buffer for polys wireframe with edge visibilityflags
98  std::vector<unsigned int> &indexArray,
99  vtkCellArray *cells,
100  vtkIdType vertexOffset, vtkDataArray *edgeflags);
101 
103  vtkCellArray *cells, vtkDataArray *edgeflags);
104 
105  // Create supporting arays that are needed when rendering cell data
106  // Some VTK cells have to be broken into smaller cells for OpenGL
107  // When we have cell data we have to map cell attributes from the VTK
108  // cell number to the actual OpenGL cell
109  // The following code fills in
110  //
111  // cellCellMap which maps a openGL cell id to the VTK cell it came from
112  //
114  vtkCellArray *[4],
115  std::vector<unsigned int> &cellCellMap,
116  int representation,
117  vtkPoints *points);
118 
119 protected:
122 
123 private:
124  vtkOpenGLIndexBufferObject(const vtkOpenGLIndexBufferObject&) VTK_DELETE_FUNCTION;
125  void operator=(const vtkOpenGLIndexBufferObject&) VTK_DELETE_FUNCTION;
126 };
127 
128 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:40
vtkOpenGLIndexBufferObject::AppendTriangleLineIndexBuffer
static void AppendTriangleLineIndexBuffer(std::vector< unsigned int > &indexArray, vtkCellArray *cells, vtkIdType vertexOffset)
vtkOpenGLIndexBufferObject::CreateCellSupportArrays
static void CreateCellSupportArrays(vtkCellArray *[4], std::vector< unsigned int > &cellCellMap, int representation, vtkPoints *points)
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:287
vtkOpenGLIndexBufferObject::CreatePointIndexBuffer
size_t CreatePointIndexBuffer(vtkCellArray *cells)
vtkOpenGLIndexBufferObject::New
static vtkOpenGLIndexBufferObject * New()
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)
vtkOpenGLIndexBufferObject
OpenGL vertex buffer object.
Definition: vtkOpenGLIndexBufferObject.h:30
vtkX3D::points
@ points
Definition: vtkX3D.h:446
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:40
vtkOpenGLIndexBufferObject::AppendEdgeFlagIndexBuffer
static void AppendEdgeFlagIndexBuffer(std::vector< unsigned int > &indexArray, vtkCellArray *cells, vtkIdType vertexOffset, vtkDataArray *edgeflags)
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:51
vtkOpenGLIndexBufferObject::AppendStripIndexBuffer
static void AppendStripIndexBuffer(std::vector< unsigned int > &indexArray, vtkCellArray *cells, vtkIdType vertexOffset, bool wireframeTriStrips)
vtkOpenGLIndexBufferObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
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)