Loading [MathJax]/extensions/tex2jax.js
VTK  9.4.20250418
vtkStaticFaceHashLinksTemplate.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
45#ifndef vtkStaticFaceHashLinksTemplate_h
46#define vtkStaticFaceHashLinksTemplate_h
47
48#include "vtkABINamespace.h"
49#include "vtkType.h"
50
51#include <memory>
52#include <vector>
53
54VTK_ABI_NAMESPACE_BEGIN
56VTK_ABI_NAMESPACE_END
57
58VTK_ABI_NAMESPACE_BEGIN
62template <typename TInputIdType, typename TFaceIdType>
64{
65public:
67
72
76 void Reset();
77
81 vtkIdType GetNumberOfFaces() const { return this->NumberOfFaces; }
82
86 vtkIdType GetNumberOfHashes() const { return this->NumberOfHashes; }
87
92 {
93 return this->FaceOffsets.get()[hash + 1] - this->FaceOffsets.get()[hash];
94 }
95
99 TInputIdType* GetCellIdOfFacesInHash(vtkIdType hash) const
100 {
101 return this->CellIdOfFaceLinks.get() + this->FaceOffsets.get()[hash];
102 }
103
107 TFaceIdType* GetFaceIdOfFacesInHash(vtkIdType hash) const
108 {
109 return this->FaceIdOfFaceLinks.get() + this->FaceOffsets.get()[hash];
110 }
111
112protected:
115 std::shared_ptr<TInputIdType> CellIdOfFaceLinks;
116 std::shared_ptr<TFaceIdType> FaceIdOfFaceLinks;
117 std::shared_ptr<vtkIdType> FaceOffsets;
118
119private:
121 void operator=(const vtkStaticFaceHashLinksTemplate&) = delete;
122
123 struct GeometryInformation;
124
125 struct CountFaces;
126
127 template <typename TCellOffSetIdType>
128 struct CreateFacesInformation;
129
130 template <typename TCellOffSetIdType>
131 struct CountHashes;
132
133 struct PrefixSum;
134
135 template <typename TCellOffSetIdType>
136 struct BuildFaceHashLinks;
137
138 template <typename TCellOffSetIdType>
139 void BuildHashLinksInternal(vtkUnstructuredGrid* input, GeometryInformation& geometryInformation);
140};
141
142VTK_ABI_NAMESPACE_END
143#include "vtkStaticFaceHashLinksTemplate.txx"
144
145#endif // vtkStaticFaceHashLinksTemplate_h
146// VTK-HeaderTest-Exclude: vtkStaticFaceHashLinksTemplate.h
Templated on types of ids defining an edge.
void BuildHashLinks(vtkUnstructuredGrid *input)
Build the hash links.
std::shared_ptr< TInputIdType > CellIdOfFaceLinks
TInputIdType * GetCellIdOfFacesInHash(vtkIdType hash) const
Get cell id of faces in a particular hash.
vtkIdType GetNumberOfHashes() const
Get the number of hashes.
void Reset()
Reset the hash links and free the memory.
TFaceIdType * GetFaceIdOfFacesInHash(vtkIdType hash) const
Get face id of faces in a particular hash.
vtkIdType GetNumberOfFacesInHash(vtkIdType hash) const
Get the number of faces in a particular hash.
std::shared_ptr< TFaceIdType > FaceIdOfFaceLinks
vtkIdType GetNumberOfFaces() const
Get number of faces.
dataset represents arbitrary combinations of all possible cell types
int vtkIdType
Definition vtkType.h:332