45 #ifndef vtkPolyDataInternals_h
46 #define vtkPolyDataInternals_h
48 #include "vtkCommonDataModelModule.h"
59 VTK_ABI_NAMESPACE_BEGIN
61 static constexpr vtkTypeUInt64
CELLID_MASK = 0x0fffffffffffffffull;
111 return static_cast<unsigned char>(
112 (
static_cast<vtkTypeUInt64
>(
target) | static_cast<vtkTypeUInt64>(var)) >> 60);
138 const size_t typeIndex =
static_cast<size_t>(
type);
139 return ((static_cast<vtkTypeUInt64>(cellId) & CELLID_MASK) |
140 (
static_cast<vtkTypeUInt64
>(TargetVarTable[typeIndex]) << 60));
147 : Value(Encode(cellId, cellType))
161 unsigned char GetCellType() const noexcept {
return TypeTable[this->GetTypeIndex()]; }
171 this->Value |= (
static_cast<vtkTypeUInt64
>(cellId) & CELLID_MASK);
175 void MarkDeleted() noexcept { this->Value &= ~TYPE_VARIANT_MASK; }
178 bool IsDeleted() const noexcept {
return (this->Value & TYPE_VARIANT_MASK) == 0; }
189 std::size_t GetTypeIndex() const noexcept {
return static_cast<std::size_t
>(this->Value >> 60); }
202 return cellType > 0 && cellType <= 10 && cellType !=
VTK_PIXEL;
209 (static_cast<vtkTypeUInt64>(cellId) & CELLID_MASK) == static_cast<vtkTypeUInt64>(cellId));
216 this->Map = other->
Map;
228 this->Map.resize(static_cast<std::size_t>(numCells));
235 return this->Map[
static_cast<std::size_t
>(cellId)];
241 this->Map[globalCellId] =
TaggedCellId(cellId, cellType);
250 return this->Map[globalCellId];
256 this->Map.emplace_back(cellId, cellType);
264 this->Map.emplace_back(
vtkIdType(0), cellType);
265 return this->Map.back();
274 this->Map.shrink_to_fit();
280 return static_cast<unsigned long>(
sizeof(
TaggedCellId) * this->Map.capacity() + 1023) / 1024;
287 std::vector<TaggedCellId>
Map;
294 VTK_ABI_NAMESPACE_END
297 #endif // vtkPolyDataInternals.h
static constexpr unsigned char GenTargetVar(Target target, TypeVariant var) noexcept
void InsertCell(vtkIdType globalCellId, vtkIdType cellId, VTKCellType cellType)
vtkIdType GetNumberOfCells() const
const TaggedCellId & GetTag(vtkIdType cellId) const
abstract base class for most VTK objects
void SetCapacity(vtkIdType numCells)
static constexpr vtkTypeUInt64 CELLID_MASK
unsigned char GetCellType() const noexcept
static constexpr vtkTypeUInt64 TYPE_VARIANT_MASK
TaggedCellId & InsertNextCell(VTKCellType cellType)
static bool ValidateCellId(vtkIdType cellId) noexcept
void SetCellId(vtkIdType cellId) noexcept
void InsertNextCell(vtkIdType cellId, VTKCellType cellType)
unsigned long GetActualMemorySize() const
void SetNumberOfCells(vtkIdType numCells)
void DeepCopy(CellMap *other)
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
TaggedCellId & GetTag(vtkIdType cellId)
static constexpr vtkTypeUInt64 TARGET_MASK
static vtkTypeUInt64 Encode(vtkIdType cellId, VTKCellType type) noexcept
std::vector< TaggedCellId > Map
static constexpr vtkTypeUInt64 SHIFTED_TYPE_INDEX_MASK
bool IsDeleted() const noexcept
static constexpr unsigned char TargetVarTable[10]
static constexpr unsigned char TypeTable[16]
static bool ValidateCellType(VTKCellType cellType) noexcept
vtkIdType GetCellId() const noexcept
void MarkDeleted() noexcept
TaggedCellId & InsertCell(vtkIdType globalCellId, VTKCellType cellType)