VTK
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 "vtkRenderingOpenGL2Module.h" // For export macro
28 #include "vtkObject.h"
29 #include "vtkStateStorage.h" // used for ivars
30 #include "vtkNew.h" // 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(
50  vtkCellArray *[4],
51  int representation,
52  vtkPoints *points);
53 
54  void BuildPrimitiveOffsetsIfNeeded(
55  vtkCellArray *[4],
56  int representation,
58  );
59 
60  vtkIdType ConvertOpenGLCellIdToVTKCellId(
61  bool pointPicking,
62  vtkIdType openGLId
63  );
64 
65  // rebuilds if needed
66  void Update(
67  vtkCellArray **prims, int representation,
68  vtkPoints *points);
69 
70  size_t GetSize() { return this->CellCellMap.size(); }
71 
73  return this->PrimitiveOffsets;
74  }
75 
76  vtkIdType GetValue(size_t i) { return this->CellCellMap[i]; }
77 
78  // what offset should verts start at
79  void SetStartOffset(vtkIdType start);
80 
82  return this->PrimitiveOffsets[3] + this->CellMapSizes[3];
83  }
84 
85 protected:
87  ~vtkOpenGLCellToVTKCellMap() override;
88 
89  std::vector<vtkIdType> CellCellMap;
90  vtkIdType CellMapSizes[4];
91  vtkIdType PrimitiveOffsets[4];
93  int StartOffset = 0;
96 
97 private:
99  void operator=(const vtkOpenGLCellToVTKCellMap&) = delete;
100 };
101 
102 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:39
vtkOpenGLCellToVTKCellMap::GetFinalOffset
vtkIdType GetFinalOffset()
Definition: vtkOpenGLCellToVTKCellMap.h:81
vtkStateStorage
Class to make storing and comparing state quick and easy.
Definition: vtkStateStorage.h:128
vtkIdType
int vtkIdType
Definition: vtkType.h:349
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:92
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:59
vtkOpenGLCellToVTKCellMap::TempState
vtkStateStorage TempState
Definition: vtkOpenGLCellToVTKCellMap.h:95
vtkOpenGLCellToVTKCellMap
OpenGL rendering utility functions.
Definition: vtkOpenGLCellToVTKCellMap.h:35
vtkX3D::points
Definition: vtkX3D.h:446
vtkOpenGLCellToVTKCellMap::GetValue
vtkIdType GetValue(size_t i)
Definition: vtkOpenGLCellToVTKCellMap.h:76
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkCellArray
object to represent cell connectivity
Definition: vtkCellArray.h:169
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:89
vtkOpenGLCellToVTKCellMap::GetSize
size_t GetSize()
Definition: vtkOpenGLCellToVTKCellMap.h:70
vtkOpenGLCellToVTKCellMap::GetPrimitiveOffsets
vtkIdType * GetPrimitiveOffsets()
Definition: vtkOpenGLCellToVTKCellMap.h:72
vtkOpenGLCellToVTKCellMap::MapBuildState
vtkStateStorage MapBuildState
Definition: vtkOpenGLCellToVTKCellMap.h:94