57#ifndef vtkPolyDataInternals_h
58#define vtkPolyDataInternals_h
62#include "vtkCommonDataModelModule.h"
74static constexpr vtkTypeUInt64
CELLID_MASK = 0x0fffffffffffffffull;
124 return static_cast<unsigned char>(
125 (
static_cast<vtkTypeUInt64
>(
target) |
static_cast<vtkTypeUInt64
>(var)) >> 60);
151 const size_t typeIndex =
static_cast<size_t>(
type);
152 return ((
static_cast<vtkTypeUInt64
>(cellId) &
CELLID_MASK) |
160 : Value(Encode(cellId, cellType))
184 this->Value |= (
static_cast<vtkTypeUInt64
>(cellId) &
CELLID_MASK);
188 void MarkDeleted() noexcept { this->Value &= ~TYPE_VARIANT_MASK; }
202 std::size_t GetTypeIndex() const noexcept {
return static_cast<std::size_t
>(this->Value >> 60); }
215 return cellType > 0 && cellType <= 10 && cellType !=
VTK_PIXEL;
222 (
static_cast<vtkTypeUInt64
>(cellId) &
CELLID_MASK) ==
static_cast<vtkTypeUInt64
>(cellId));
229 this->Map = other->
Map;
243 return this->Map[
static_cast<std::size_t
>(cellId)];
249 this->Map.emplace_back(cellId, cellType);
257 this->Map.emplace_back(
vtkIdType(0), cellType);
258 return this->Map.back();
267 this->Map.shrink_to_fit();
273 return static_cast<unsigned long>(
sizeof(
TaggedCellId) * this->Map.capacity() + 1023) / 1024;
280 std::vector<TaggedCellId>
Map;
abstract base class for most VTK objects
static bool ValidateCellId(vtkIdType cellId) noexcept
vtkIdType GetNumberOfCells() const
unsigned long GetActualMemorySize() const
void SetCapacity(vtkIdType numCells)
const TaggedCellId & GetTag(vtkIdType cellId) const
std::vector< TaggedCellId > Map
static bool ValidateCellType(VTKCellType cellType) noexcept
TaggedCellId & InsertNextCell(VTKCellType cellType)
void DeepCopy(CellMap *other)
void InsertNextCell(vtkIdType cellId, VTKCellType cellType)
TaggedCellId & GetTag(vtkIdType cellId)
static constexpr unsigned char TypeTable[16]
static constexpr vtkTypeUInt64 CELLID_MASK
static constexpr vtkTypeUInt64 SHIFTED_TYPE_INDEX_MASK
static constexpr unsigned char GenTargetVar(Target target, TypeVariant var) noexcept
static constexpr vtkTypeUInt64 TARGET_MASK
static constexpr vtkTypeUInt64 TYPE_VARIANT_MASK
static constexpr unsigned char TargetVarTable[10]
unsigned char GetCellType() const noexcept
TaggedCellId() noexcept=default
void MarkDeleted() noexcept
TaggedCellId(TaggedCellId &&) noexcept=default
vtkIdType GetCellId() const noexcept
void SetCellId(vtkIdType cellId) noexcept
TaggedCellId(const TaggedCellId &) noexcept=default
static vtkTypeUInt64 Encode(vtkIdType cellId, VTKCellType type) noexcept
bool IsDeleted() const noexcept
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)