VTK  9.0.20200807
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 
32 class vtkCellArray;
33 class vtkPoints;
34 
35 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLCellToVTKCellMap : public vtkObject
36 {
37 public:
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 
51  void BuildPrimitiveOffsetsIfNeeded(vtkCellArray * [4], int representation, vtkPoints* points);
52 
53  vtkIdType ConvertOpenGLCellIdToVTKCellId(bool pointPicking, vtkIdType openGLId);
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
65  void SetStartOffset(vtkIdType start);
66 
67  vtkIdType GetFinalOffset() { return this->PrimitiveOffsets[3] + this->CellMapSizes[3]; }
68 
69 protected:
71  ~vtkOpenGLCellToVTKCellMap() override;
72 
73  std::vector<vtkIdType> CellCellMap;
74  vtkIdType CellMapSizes[4];
75  vtkIdType PrimitiveOffsets[4];
77  int StartOffset = 0;
80 
81 private:
83  void operator=(const vtkOpenGLCellToVTKCellMap&) = delete;
84 };
85 
86 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:33
vtkOpenGLCellToVTKCellMap::GetFinalOffset
vtkIdType GetFinalOffset()
Definition: vtkOpenGLCellToVTKCellMap.h:67
vtkStateStorage
Class to make storing and comparing state quick and easy.
Definition: vtkStateStorage.h:131
vtkIdType
int vtkIdType
Definition: vtkType.h:330
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkStateStorage.h
vtkOpenGLCellToVTKCellMap::BuildRepresentation
int BuildRepresentation
Definition: vtkOpenGLCellToVTKCellMap.h:76
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkOpenGLCellToVTKCellMap::TempState
vtkStateStorage TempState
Definition: vtkOpenGLCellToVTKCellMap.h:79
vtkOpenGLCellToVTKCellMap
OpenGL rendering utility functions.
Definition: vtkOpenGLCellToVTKCellMap.h:35
vtkX3D::points
Definition: vtkX3D.h:452
vtkOpenGLCellToVTKCellMap::GetValue
vtkIdType GetValue(size_t i)
Definition: vtkOpenGLCellToVTKCellMap.h:62
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:180
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkObject.h
vtkNew.h
vtkOpenGLCellToVTKCellMap::CellCellMap
std::vector< vtkIdType > CellCellMap
Definition: vtkOpenGLCellToVTKCellMap.h:73
vtkOpenGLCellToVTKCellMap::GetSize
size_t GetSize()
Definition: vtkOpenGLCellToVTKCellMap.h:58
vtkOpenGLCellToVTKCellMap::GetPrimitiveOffsets
vtkIdType * GetPrimitiveOffsets()
Definition: vtkOpenGLCellToVTKCellMap.h:60
vtkOpenGLCellToVTKCellMap::MapBuildState
vtkStateStorage MapBuildState
Definition: vtkOpenGLCellToVTKCellMap.h:78