VTK  9.1.0
vtkOpenGLCellToVTKCellMap.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkOpenGLCellToVTKCellMap.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
24#ifndef vtkOpenGLCellToVTKCellMap_h
25#define vtkOpenGLCellToVTKCellMap_h
26
27#include "vtkNew.h" // for ivars
28#include "vtkObject.h"
29#include "vtkRenderingOpenGL2Module.h" // For export macro
30#include "vtkStateStorage.h" // used for ivars
31
32class vtkCellArray;
33class vtkPoints;
34
35class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLCellToVTKCellMap : public vtkObject
36{
37public:
40 void PrintSelf(ostream& os, vtkIndent indent) override;
41
42 // Create supporting arrays that are needed when rendering cell data
43 // Some VTK cells have to be broken into smaller cells for OpenGL
44 // When we have cell data we have to map cell attributes from the VTK
45 // cell number to the actual OpenGL cell
46 //
47 // The same concept applies to cell based picking
48 //
49 void BuildCellSupportArrays(vtkCellArray * [4], int representation, vtkPoints* points);
50
52
54
55 // rebuilds if needed
56 void Update(vtkCellArray** prims, int representation, vtkPoints* points);
57
58 size_t GetSize() { return this->CellCellMap.size(); }
59
60 vtkIdType* GetPrimitiveOffsets() { return this->PrimitiveOffsets; }
61
62 vtkIdType GetValue(size_t i) { return this->CellCellMap[i]; }
63
64 // what offset should verts start at
66
67 vtkIdType GetFinalOffset() { return this->PrimitiveOffsets[3] + this->CellMapSizes[3]; }
68
69protected:
72
73 std::vector<vtkIdType> CellCellMap;
74 vtkIdType CellMapSizes[4];
75 vtkIdType PrimitiveOffsets[4];
77 int StartOffset = 0;
80
81private:
83 void operator=(const vtkOpenGLCellToVTKCellMap&) = delete;
84};
85
86#endif
object to represent cell connectivity
Definition: vtkCellArray.h:290
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:73
OpenGL rendering utility functions.
void BuildPrimitiveOffsetsIfNeeded(vtkCellArray *[4], int representation, vtkPoints *points)
void Update(vtkCellArray **prims, int representation, vtkPoints *points)
void SetStartOffset(vtkIdType start)
std::vector< vtkIdType > CellCellMap
static vtkOpenGLCellToVTKCellMap * New()
~vtkOpenGLCellToVTKCellMap() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkIdType ConvertOpenGLCellIdToVTKCellId(bool pointPicking, vtkIdType openGLId)
void BuildCellSupportArrays(vtkCellArray *[4], int representation, vtkPoints *points)
represent and manipulate 3D points
Definition: vtkPoints.h:143
Class to make storing and comparing state quick and easy.
@ points
Definition: vtkX3D.h:452
int vtkIdType
Definition: vtkType.h:332