VTK  9.7.1
vtkCellGraphicsPrimitiveMap.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
3 
16 #ifndef vtkCellGraphicsPrimitiveMap_h
17 #define vtkCellGraphicsPrimitiveMap_h
18 
19 #include "vtkObject.h"
20 
21 #include "vtkRenderingCoreModule.h" // For export macro
22 #include "vtkSmartPointer.h" // For vtkSmartPointer
23 #include "vtkTypeInt32Array.h" // For PrimitiveDescriptor::[PrimitiveToCell, VertexIDs]
24 #include "vtkTypeUInt8Array.h" // For PrimitiveDescriptor::EdgeArray
25 
26 VTK_ABI_NAMESPACE_BEGIN
27 class vtkPolyData;
28 
29 class VTKRENDERINGCORE_EXPORT vtkCellGraphicsPrimitiveMap : public vtkObject
30 {
31 public:
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35 
37  {
38  vtkIdType CellIdOffset = 0;
39  vtkIdType EdgeValueBufferOffset = 0;
40  // added to a mesh-local point ID to reach the global index into the concatenated positions TBO.
41  vtkIdType PointIdOffset = 0;
42  vtkIdType PrimitiveIdOffset = 0;
43  // where this mesh's cell connectivity slice begins inside the concatenated connectivity (the
44  // vertexIdBuffer TBO/IBO).
45  vtkIdType VertexIdOffset = 0;
46  friend std::ostream& operator<<(std::ostream& os, const CellTypeMapperOffsets& offsets)
47  {
48  os << "\nCellIdOffset: " << offsets.CellIdOffset << '\n'
49  << "EdgeValueBufferOffset: " << offsets.EdgeValueBufferOffset << '\n'
50  << "PointIdOffset: " << offsets.PointIdOffset << '\n'
51  << "PrimitiveIdOffset: " << offsets.PrimitiveIdOffset << '\n'
52  << "VertexIdOffset: " << offsets.VertexIdOffset << '\n';
53  return os;
54  }
55  };
56 
58  {
60  // mesh-local cell ids for each OpenGL primitive.
62  // mesh-local connectivity entries.
64  int PrimitiveSize = 0;
65  vtkTypeInt32 LocalCellIdOffset = 0;
66  };
68  static PrimitiveDescriptor ProcessVertices(vtkPolyData* mesh);
70  static PrimitiveDescriptor ProcessLines(vtkPolyData* mesh);
73  static PrimitiveDescriptor ProcessPolygons(vtkPolyData* mesh);
75  static PrimitiveDescriptor ProcessStrips(vtkPolyData* mesh);
76 
77 protected:
79  ~vtkCellGraphicsPrimitiveMap() override;
80 
81 private:
83  void operator=(const vtkCellGraphicsPrimitiveMap&) = delete;
84 };
85 
86 VTK_ABI_NAMESPACE_END
87 #endif
Maps cell connectivity and offsets from VTK data model into primitives that graphics libraries expect...
abstract base class for most VTK objects
Definition: vtkObject.h:52
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int vtkIdType
Definition: vtkType.h:363
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:71
a simple class to control print indentation
Definition: vtkIndent.h:28
friend std::ostream & operator<<(std::ostream &os, const CellTypeMapperOffsets &offsets)
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...