236#ifndef vtkCellArray_h
237#define vtkCellArray_h
240#include "vtkCommonDataModelModule.h"
243#include "vtkAffineTypeInt32Array.h"
244#include "vtkAffineTypeInt64Array.h"
248#include "vtkFeatures.h"
250#include "vtkTypeInt32Array.h"
251#include "vtkTypeInt64Array.h"
255#include <initializer_list>
256#include <type_traits>
259VTK_ABI_NAMESPACE_BEGIN
292 "Use vtkArrayDispatch::StorageOffsetsArrays/StorageConnectivityArrays instead.") =
293 vtkTypeList::Create<ArrayType32, ArrayType64>;
306 "Use vtkArrayDispatch::InputOffsetsArrays/InputConnectivityArrays instead.") =
322 return this->AllocateExact(sz, sz) ? 1 : 0;
336 return this->AllocateExact(numCells, numCells * maxCellSize);
420 return static_cast<vtkIdType>(this->Offsets->GetComponent(cellId, 0));
428 this->Offsets->SetComponent(cellId, 0,
static_cast<double>(offset));
436 return this->Connectivity->GetNumberOfValues();
463 void SetData(vtkTypeInt32Array* offsets, vtkTypeInt32Array* connectivity);
464 void SetData(vtkTypeInt64Array* offsets, vtkTypeInt64Array* connectivity);
470 void SetData(vtkAffineTypeInt32Array* offsets, vtkTypeInt32Array* connectivity);
471 void SetData(vtkAffineTypeInt64Array* offsets, vtkTypeInt64Array* connectivity);
547 return this->IsStorageFixedSize32Bit() || this->IsStorageFixedSize64Bit();
563 switch (this->StorageType)
565 case StorageTypes::Int32:
566 case StorageTypes::FixedSizeInt32:
567 return std::is_same_v<vtkTypeInt32, vtkIdType>;
568 case StorageTypes::Int64:
569 case StorageTypes::FixedSizeInt64:
570 return std::is_same_v<vtkTypeInt64, vtkIdType>;
571 case StorageTypes::Generic:
611 case StorageTypes::Int32:
612 return this->CanConvertTo32BitStorage();
613 case StorageTypes::Int64:
614 return this->CanConvertTo64BitStorage();
615 case StorageTypes::FixedSizeInt32:
616 return this->CanConvertToFixedSize32BitStorage();
617 case StorageTypes::FixedSizeInt64:
618 return this->CanConvertToFixedSize64BitStorage();
619 case StorageTypes::Generic:
653 case StorageTypes::Int32:
654 return this->ConvertTo32BitStorage();
655 case StorageTypes::Int64:
656 return this->ConvertTo64BitStorage();
657 case StorageTypes::FixedSizeInt32:
658 return this->ConvertToFixedSize32BitStorage();
659 case StorageTypes::FixedSizeInt64:
660 return this->ConvertToFixedSize64BitStorage();
661 case StorageTypes::Generic:
678 return AffineArrayType32::FastDownCast(this->Offsets);
682 return AffineArrayType64::FastDownCast(this->Offsets);
695 return ArrayType32::FastDownCast(this->Connectivity);
699 return ArrayType64::FastDownCast(this->Connectivity);
722 void InitTraversal();
789 VTK_EXPECTS(0 <= cellPointIndex && cellPointIndex < this->GetCellSize(cellId));
822 return this->InsertNextCell(
static_cast<vtkIdType>(cell.size()), cell.begin());
843 void UpdateCellCount(
int npts);
892 this->ReplaceCellAtId(cellId,
static_cast<vtkIdType>(cell.size()), cell.begin());
967 unsigned long GetActualMemorySize() const;
979 template <
class ArrayT>
982 template <
class OffsetsT>
985 return offsets->GetNumberOfValues() - 1;
988 template <
class ArrayT>
989 static decltype(vtk::DataArrayValueRange<1, vtkIdType>(std::declval<ArrayT>()))
GetRange(
992 return vtk::DataArrayValueRange<1, vtkIdType>(array);
995 template <
class OffsetsT>
998 return static_cast<vtkIdType>(GetRange(offsets)[cellId]);
1001 template <
class OffsetsT>
1004 return static_cast<vtkIdType>(GetRange(offsets)[cellId + 1]);
1007 template <
class OffsetsT>
1010 auto offsetsRange = GetRange(offsets);
1011 return static_cast<vtkIdType>(offsetsRange[cellId + 1] - offsetsRange[cellId]);
1014 template <
class OffsetsT,
class ConnectivityT>
1015 static decltype(vtk::DataArrayValueRange<1, vtkIdType>(std::declval<ConnectivityT>()))
1018 auto offsetsRange = GetRange(offsets);
1019 return vtk::DataArrayValueRange<1, vtkIdType>(
1020 conn, offsetsRange[cellId], offsetsRange[cellId + 1]);
1088 template <
typename Functor,
typename... Args>
1091 switch (this->StorageType)
1093 case StorageTypes::Int32:
1094 functor(
static_cast<ArrayType32*
>(this->Offsets.Get()),
1095 static_cast<ArrayType32*
>(this->Connectivity.Get()), std::forward<Args>(args)...);
1097 case StorageTypes::Int64:
1098 functor(
static_cast<ArrayType64*
>(this->Offsets.Get()),
1099 static_cast<ArrayType64*
>(this->Connectivity.Get()), std::forward<Args>(args)...);
1101 case StorageTypes::FixedSizeInt32:
1103 static_cast<ArrayType32*
>(this->Connectivity.Get()), std::forward<Args>(args)...);
1105 case StorageTypes::FixedSizeInt64:
1107 static_cast<ArrayType64*
>(this->Connectivity.Get()), std::forward<Args>(args)...);
1109 case StorageTypes::Generic:
1111 functor(this->Offsets.Get(), this->Connectivity.Get(), std::forward<Args>(args)...);
1115 template <
typename Functor,
typename... Args>
1118 switch (this->StorageType)
1120 case StorageTypes::Int32:
1121 functor(
static_cast<ArrayType32*
>(this->Offsets.Get()),
1122 static_cast<ArrayType32*
>(this->Connectivity.Get()), std::forward<Args>(args)...);
1124 case StorageTypes::Int64:
1125 functor(
static_cast<ArrayType64*
>(this->Offsets.Get()),
1126 static_cast<ArrayType64*
>(this->Connectivity.Get()), std::forward<Args>(args)...);
1128 case StorageTypes::FixedSizeInt32:
1130 static_cast<ArrayType32*
>(this->Connectivity.Get()), std::forward<Args>(args)...);
1132 case StorageTypes::FixedSizeInt64:
1134 static_cast<ArrayType64*
>(this->Connectivity.Get()), std::forward<Args>(args)...);
1136 case StorageTypes::Generic:
1138 functor(this->Offsets.Get(), this->Connectivity.Get(), std::forward<Args>(args)...);
1146 template <
typename ArrayT>
1151 using CellRangeType =
decltype(vtk::DataArrayValueRange<1>(std::declval<ArrayType>()));
1158 static constexpr bool ValueTypeIsSameAsIdType = std::is_integral<ValueType>::value &&
1175 CellRangeType GetCellRange(
vtkIdType cellId);
1184 this->Offsets->InsertNextValue(0);
1187 this->IsInMemkind =
true;
1191 void*
operator new(
size_t nSize)
1194#ifdef VTK_USE_MEMKIND
1201 void operator delete(
void* p)
1203#ifdef VTK_USE_MEMKIND
1224 bool IsInMemkind =
false;
1228 template <
typename Functor,
typename... Args>
1229 using GetReturnType =
decltype(std::declval<Functor>()(
1230 std::declval<VisitState<ArrayType32>&>(), std::declval<Args>()...));
1232 template <
typename Functor,
typename... Args>
1233 struct ReturnsVoid : std::is_same<GetReturnType<Functor, Args...>, void>
1307 template <
typename Functor,
typename... Args,
1308 typename =
typename std::enable_if<ReturnsVoid<Functor, Args...>::value>::type>
1310 void Visit(Functor&& functor, Args&&... args)
1312 switch (this->StorageType)
1314 case StorageTypes::Int32:
1317 state.
Offsets = ArrayType32::FastDownCast(this->Offsets);
1318 state.
Connectivity = ArrayType32::FastDownCast(this->Connectivity);
1319 functor(state, std::forward<Args>(args)...);
1322 case StorageTypes::Int64:
1325 state.
Offsets = ArrayType64::FastDownCast(this->Offsets);
1326 state.
Connectivity = ArrayType64::FastDownCast(this->Connectivity);
1327 functor(state, std::forward<Args>(args)...);
1330 case StorageTypes::FixedSizeInt32:
1331 case StorageTypes::FixedSizeInt64:
1332 case StorageTypes::Generic:
1335 vtkWarningMacro(
"Use Dispatch");
1341 template <
typename Functor,
typename... Args,
1342 typename =
typename std::enable_if<ReturnsVoid<Functor, Args...>::value>::type>
1344 void Visit(Functor&& functor, Args&&... args)
const
1346 switch (this->StorageType)
1348 case StorageTypes::Int32:
1351 state.
Offsets = ArrayType32::FastDownCast(this->Offsets);
1352 state.
Connectivity = ArrayType32::FastDownCast(this->Connectivity);
1353 functor(state, std::forward<Args>(args)...);
1356 case StorageTypes::Int64:
1359 state.
Offsets = ArrayType64::FastDownCast(this->Offsets);
1360 state.
Connectivity = ArrayType64::FastDownCast(this->Connectivity);
1361 functor(state, std::forward<Args>(args)...);
1364 case StorageTypes::FixedSizeInt32:
1365 case StorageTypes::FixedSizeInt64:
1366 case StorageTypes::Generic:
1369 vtkWarningMacro(
"Use Dispatch");
1375 template <
typename Functor,
typename... Args,
1376 typename =
typename std::enable_if<!ReturnsVoid<Functor, Args...>::value>::type>
1378 GetReturnType<Functor, Args...> Visit(Functor&& functor, Args&&... args)
1380 switch (this->StorageType)
1382 case StorageTypes::Int32:
1385 state.
Offsets = ArrayType32::FastDownCast(this->Offsets);
1386 state.
Connectivity = ArrayType32::FastDownCast(this->Connectivity);
1387 return functor(state, std::forward<Args>(args)...);
1389 case StorageTypes::Int64:
1392 state.
Offsets = ArrayType64::FastDownCast(this->Offsets);
1393 state.
Connectivity = ArrayType64::FastDownCast(this->Connectivity);
1394 return functor(state, std::forward<Args>(args)...);
1396 case StorageTypes::FixedSizeInt32:
1397 case StorageTypes::FixedSizeInt64:
1398 case StorageTypes::Generic:
1401 vtkWarningMacro(
"Use Dispatch");
1402 return GetReturnType<Functor, Args...>();
1406 template <
typename Functor,
typename... Args,
1407 typename =
typename std::enable_if<!ReturnsVoid<Functor, Args...>::value>::type>
1409 GetReturnType<Functor, Args...> Visit(Functor&& functor, Args&&... args)
const
1411 switch (this->StorageType)
1413 case StorageTypes::Int32:
1416 state.
Offsets = ArrayType32::FastDownCast(this->Offsets);
1417 state.
Connectivity = ArrayType32::FastDownCast(this->Connectivity);
1418 return functor(state, std::forward<Args>(args)...);
1420 case StorageTypes::Int64:
1423 state.
Offsets = ArrayType64::FastDownCast(this->Offsets);
1424 state.
Connectivity = ArrayType64::FastDownCast(this->Connectivity);
1425 return functor(state, std::forward<Args>(args)...);
1427 case StorageTypes::FixedSizeInt32:
1428 case StorageTypes::FixedSizeInt64:
1429 case StorageTypes::Generic:
1432 vtkWarningMacro(
"Use Dispatch");
1433 return GetReturnType<Functor, Args...>();
1519 VTK_EXPECTS(0 <= loc && loc < GetNumberOfConnectivityEntries());
1598 "Use ExportLegacyFormat, or GetOffsetsArray/GetConnectivityArray instead.")
1623template <
typename ArrayT>
1626 return this->Offsets->GetNumberOfValues() - 1;
1629template <
typename ArrayT>
1632 return static_cast<vtkIdType>(this->Offsets->GetValue(cellId));
1635template <
typename ArrayT>
1638 return static_cast<vtkIdType>(this->Offsets->GetValue(cellId + 1));
1641template <
typename ArrayT>
1644 return this->GetEndOffset(cellId) - this->GetBeginOffset(cellId);
1647template <
typename ArrayT>
1651 return vtk::DataArrayValueRange<1>(
1652 this->GetConnectivity(), this->GetBeginOffset(cellId), this->GetEndOffset(cellId));
1654VTK_ABI_NAMESPACE_END
1658VTK_ABI_NAMESPACE_BEGIN
1663 template <
class OffsetsT,
class ConnectivityT>
1670 OffsetsAccessorType offsetsAccesor(offsets);
1671 ConnectivityAccessorType connAccesor(conn);
1673 cellId = offsets->GetNumberOfValues() - 1;
1675 offsetsAccesor.InsertNext(
static_cast<ValueType
>(conn->GetNumberOfValues() + npts));
1679 connAccesor.InsertNext(
static_cast<ValueType
>(pts[i]));
1684 template <
class OffsetsT,
class ConnectivityT>
1689 AccessorType offsetsAccesor(offsets);
1691 cellId = offsets->GetNumberOfValues() - 1;
1693 offsetsAccesor.InsertNext(
static_cast<ValueType
>(conn->GetNumberOfValues() + npts));
1700 template <
class OffsetsT,
class ConnectivityT>
1705 auto offsetsRange = GetRange(offsets);
1706 const ValueType cellBegin = offsetsRange[offsets->GetMaxId() - 1];
1707 offsetsRange[offsets->GetMaxId()] =
static_cast<ValueType
>(cellBegin + npts);
1713 template <
class OffsetsT,
class ConnectivityT>
1715 OffsetsT* offsets, ConnectivityT* vtkNotUsed(conn),
vtkIdType cellId,
vtkIdType& cellSize)
1717 cellSize = GetCellSize(offsets, cellId);
1723 template <
class OffsetsT,
class ConnectivityT>
1726 auto offsetsRange = GetRange(offsets);
1727 const auto& beginOffset = offsetsRange[cellId];
1728 const auto& endOffset = offsetsRange[cellId + 1];
1730 const auto cellConnectivity = GetRange(conn).begin() + beginOffset;
1735 for (
vtkIdType i = 0; i < cellSize; ++i)
1737 idPtr[i] =
static_cast<vtkIdType>(cellConnectivity[i]);
1741 template <
class OffsetsT,
class ConnectivityT>
1745 auto offsetsRange = GetRange(offsets);
1746 const auto& beginOffset = offsetsRange[cellId];
1747 const auto& endOffset = offsetsRange[cellId + 1];
1748 cellSize =
static_cast<vtkIdType>(endOffset - beginOffset);
1749 const auto cellConnectivity = GetRange(conn).begin() + beginOffset;
1752 for (
vtkIdType i = 0; i < cellSize; ++i)
1754 cellPoints[i] =
static_cast<vtkIdType>(cellConnectivity[i]);
1759 template <
typename ConnectivityT>
1762 static constexpr bool value =
1763 std::is_base_of_v<vtkAOSDataArrayTemplate<vtkIdType>, ConnectivityT>;
1766 template <
class OffsetsT,
class ConnectivityT>
1767 typename std::enable_if_t<CanShareConnPtr<ConnectivityT>::value,
void>
operator()(
1771 auto offsetsRange = GetRange(offsets);
1772 const auto& beginOffset = offsetsRange[cellId];
1773 const auto& endOffset = offsetsRange[cellId + 1];
1774 cellSize =
static_cast<vtkIdType>(endOffset - beginOffset);
1776 cellPoints = conn->GetPointer(beginOffset);
1779 template <
class OffsetsT,
class ConnectivityT>
1780 typename std::enable_if_t<!CanShareConnPtr<ConnectivityT>::value,
void>
operator()(
1784 auto offsetsRange = GetRange(offsets);
1785 const auto& beginOffset = offsetsRange[cellId];
1786 const auto& endOffset = offsetsRange[cellId + 1];
1787 cellSize =
static_cast<vtkIdType>(endOffset - beginOffset);
1788 const auto cellConnectivity = GetRange(conn).begin() + beginOffset;
1792 for (
vtkIdType i = 0; i < cellSize; ++i)
1794 tempPtr[i] =
static_cast<vtkIdType>(cellConnectivity[i]);
1797 cellPoints = tempPtr;
1803 template <
class OffsetsT,
class ConnectivityT>
1808 static_cast<vtkIdType>(GetRange(conn)[GetBeginOffset(offsets, cellId) + cellPointIndex]);
1814 template <
class OffsetsT,
class ConnectivityT>
1821 AccessorType accessor(offsets);
1822 ValueType firstOffset = 0;
1823 accessor.InsertNext(firstOffset);
1829 template <
class OffsetsT,
class ConnectivityT>
1834 AccessorType accessor(conn);
1835 accessor.InsertNext(
static_cast<ValueType
>(
id));
1839VTK_ABI_NAMESPACE_END
1842VTK_ABI_NAMESPACE_BEGIN
1852 if (this->TraversalCellId < this->GetNumberOfCells())
1854 this->GetCellAtId(this->TraversalCellId, npts, pts);
1855 ++this->TraversalCellId;
1966VTK_ABI_NAMESPACE_END
Array-Of-Structs implementation of vtkGenericDataArray.
abstract object to represent cell connectivity
virtual vtkIdType GetNumberOfCells() const =0
Get the number of cells in the array.
void GetCellAtId(vtkIdType cellId, vtkIdType &cellSize, vtkIdType const *&cellPoints)
Return the point ids for the cell at cellId.
Encapsulate traversal logic for vtkCellArray.
object to represent cell connectivity
vtkIdType GetCellSize(vtkIdType cellId) const override
Return the size of the cell at cellId.
vtkDataArray * GetOffsetsArray() const
Return the array used to store cell offsets.
void SetData(vtkAOSDataArrayTemplate< int > *offsets, vtkAOSDataArrayTemplate< int > *connectivity)
Set the internal data arrays to the supplied offsets and connectivity arrays.
int GetNextCell(vtkIdType &npts, vtkIdType const *&pts)
void UseFixedSizeDefaultStorage(vtkIdType cellSize)
Initialize internal data structures to use 32- or 64-bit storage.
vtkTypeList::Unique< vtkTypeList::Create< vtkAOSDataArrayTemplate< int >, vtkAOSDataArrayTemplate< long >, vtkAOSDataArrayTemplate< long long > > >::Result InputArrayList
List of possible ArrayTypes that are compatible with internal storage.
vtkIdType GetOffset(vtkIdType cellId) override
Get the offset (into the connectivity) for a specified cell id.
void SetData(vtkTypeInt32Array *offsets, vtkTypeInt32Array *connectivity)
Set the internal data arrays to the supplied offsets and connectivity arrays.
AffineArrayType64 * GetOffsetsAffineArray64()
Return the array used to store cell offsets.
vtkAffineTypeInt32Array AffineArrayType32
void UseDefaultStorage()
Initialize internal data structures to use 32- or 64-bit storage.
bool AllocateCopy(vtkCellArray *other)
Pre-allocate memory in internal data structures to match the used size of the input vtkCellArray.
void AppendLegacyFormat(vtkIdTypeArray *data, vtkIdType ptOffset=0)
Append an array of data with the legacy vtkCellArray layout, e.g.:
static void SetDefaultStorageIs64Bit(bool val)
Control the default internal storage size.
AffineArrayType32 * GetOffsetsAffineArray32()
Return the array used to store cell offsets.
void DeepCopy(vtkAbstractCellArray *ca) override
Perform a deep copy (no reference counting) of the given cell array.
bool IsValid()
Check that internal storage is consistent and in a valid state.
void AppendLegacyFormat(const vtkIdType *data, vtkIdType len, vtkIdType ptOffset=0)
Append an array of data with the legacy vtkCellArray layout, e.g.:
bool SetData(vtkIdType cellSize, vtkDataArray *connectivity)
Sets the internal arrays to the supported connectivity array with an offsets array automatically gene...
void ShallowCopy(vtkAbstractCellArray *ca) override
Shallow copy ca into this cell array.
vtkIdType GetNumberOfOffsets() const override
Get the number of elements in the offsets array.
bool CanConvertToFixedSize64BitStorage() const
Check if the existing data can safely be converted to use 32- or 64- bit storage.
void SetData(vtkAffineTypeInt32Array *offsets, vtkTypeInt32Array *connectivity)
Set the internal data arrays to the supplied offsets and connectivity arrays.
vtkIdType GetTraversalCellId()
Get/Set the current cellId for traversal.
vtkTypeInt32Array ArrayType32
vtkIdType GetNumberOfCells() const override
Get the number of cells in the array.
bool CanConvertToFixedSizeDefaultStorage() const
Check if the existing data can safely be converted to use 32- or 64- bit storage.
vtkIdType GetNumberOfConnectivityIds() const override
Get the size of the connectivity array that stores the point ids.
bool CanConvertToStorageType(StorageTypes type) const
Check if the existing data can safely be converted to use 32- or 64- bit storage.
bool ConvertToFixedSize64BitStorage()
Convert internal data structures to use 32- or 64-bit storage.
void SetData(vtkAOSDataArrayTemplate< long long > *offsets, vtkAOSDataArrayTemplate< long long > *connectivity)
Set the internal data arrays to the supplied offsets and connectivity arrays.
bool AllocateExact(vtkIdType numCells, vtkIdType connectivitySize)
Pre-allocate memory in internal data structures.
bool ResizeExact(vtkIdType numCells, vtkIdType connectivitySize)
ResizeExact() resizes the internal structures to hold numCells total cell offsets and connectivitySiz...
bool AllocateEstimate(vtkIdType numCells, vtkIdType maxCellSize)
Pre-allocate memory in internal data structures.
vtkTypeInt64Array ArrayType64
void SetData(vtkAffineTypeInt64Array *offsets, vtkTypeInt64Array *connectivity)
Set the internal data arrays to the supplied offsets and connectivity arrays.
void SetData(vtkAffineArray< long > *offsets, vtkAOSDataArrayTemplate< long > *connectivity)
Set the internal data arrays to the supplied offsets and connectivity arrays.
vtkIdType TraversalCellId
void UseFixedSize64BitStorage(vtkIdType cellSize)
Initialize internal data structures to use 32- or 64-bit storage.
bool IsStorageShareable() const override
bool IsStorageGeneric() const
void Use64BitStorage()
Initialize internal data structures to use 32- or 64-bit storage.
ArrayType32 * GetConnectivityArray32() const
Return the array used to store the point ids that define the cells' connectivity.
vtkDataArray * GetConnectivityArray() const
Return the array used to store the point ids that define the cells' connectivity.
bool ConvertToDefaultStorage()
Convert internal data structures to use 32- or 64-bit storage.
bool CanConvertToDefaultStorage() const
Check if the existing data can safely be converted to use 32- or 64- bit storage.
static bool DefaultStorageIs64Bit
bool CanConvertTo32BitStorage() const
Check if the existing data can safely be converted to use 32- or 64- bit storage.
void GetCellAtId(vtkIdType cellId, vtkIdType &cellSize, vtkIdType const *&cellPoints, vtkIdList *ptIds) override
Return the point ids for the cell at cellId.
void InsertCellPoint(vtkIdType id)
Used in conjunction with InsertNextCell(npts) to add another point to the list of cells.
vtkCellArrayIterator * NewIterator()
NewIterator returns a new instance of vtkCellArrayIterator that is initialized to point at the first ...
vtkAffineTypeInt64Array AffineArrayType64
void ReplaceCellAtId(vtkIdType cellId, vtkIdList *list)
Replaces the point ids for the specified cell with the supplied list.
void UseFixedSize32BitStorage(vtkIdType cellSize)
Initialize internal data structures to use 32- or 64-bit storage.
void ReverseCellAtId(vtkIdType cellId)
Reverses the order of the point ids for the specified cell.
bool IsStorage32Bit() const
void SetData(vtkAffineArray< int > *offsets, vtkAOSDataArrayTemplate< int > *connectivity)
Set the internal data arrays to the supplied offsets and connectivity arrays.
bool SetData(vtkDataArray *offsets, vtkDataArray *connectivity)
Sets the internal arrays to the supplied offsets and connectivity arrays.
void Initialize() override
Free any memory and reset to an empty state.
void Squeeze()
Reclaim any extra memory while preserving data.
void SetData(vtkIdTypeArray *offsets, vtkIdTypeArray *connectivity)
Set the internal data arrays to the supplied offsets and connectivity arrays.
bool IsStorageFixedSize32Bit() const
bool ConvertTo32BitStorage()
Convert internal data structures to use 32- or 64-bit storage.
bool ConvertToFixedSizeDefaultStorage()
Convert internal data structures to use 32- or 64-bit storage.
bool ConvertToStorageType(StorageTypes type)
Convert internal data structures to use 32- or 64-bit storage.
void SetOffset(vtkIdType cellId, vtkIdType offset)
Set the offset (into the connectivity) for a specified cell id.
bool ConvertToSmallestStorage()
Convert internal data structures to use 32- or 64-bit storage.
void ExportLegacyFormat(vtkIdTypeArray *data)
Fill data with the old-style vtkCellArray data layout, e.g.
bool ConvertTo64BitStorage()
Convert internal data structures to use 32- or 64-bit storage.
bool ConvertToFixedSize32BitStorage()
Convert internal data structures to use 32- or 64-bit storage.
void SetData(vtkAOSDataArrayTemplate< long > *offsets, vtkAOSDataArrayTemplate< long > *connectivity)
Set the internal data arrays to the supplied offsets and connectivity arrays.
void ImportLegacyFormat(const vtkIdType *data, vtkIdType len)
Import an array of data with the legacy vtkCellArray layout, e.g.:
void SetData(vtkAffineArray< vtkIdType > *offsets, vtkIdTypeArray *connectivity)
Set the internal data arrays to the supplied offsets and connectivity arrays.
void ImportLegacyFormat(vtkIdTypeArray *data)
Import an array of data with the legacy vtkCellArray layout, e.g.:
void Use32BitStorage()
Initialize internal data structures to use 32- or 64-bit storage.
vtkIdType GetCellPointAtId(vtkIdType cellId, vtkIdType cellPointIndex) const
Return the point id at cellPointIndex for the cell at cellId.
void SetTraversalCellId(vtkIdType cellId)
Get/Set the current cellId for traversal.
void SetData(vtkTypeInt64Array *offsets, vtkTypeInt64Array *connectivity)
Set the internal data arrays to the supplied offsets and connectivity arrays.
bool IsStorageFixedSize64Bit() const
static bool GetDefaultStorageIs64Bit()
Control the default internal storage size.
int GetMaxCellSize() override
Returns the size of the largest cell.
vtkIdType InsertNextCell(vtkCell *cell)
Insert a cell object.
void SetData(vtkAffineArray< long long > *offsets, vtkAOSDataArrayTemplate< long long > *connectivity)
Set the internal data arrays to the supplied offsets and connectivity arrays.
vtkNew< vtkIdTypeArray > LegacyData
void Dispatch(Functor &&functor, Args &&... args)
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instantiation, type information, and printing.
void PrintDebug(ostream &os)
Standard methods for instantiation, type information, and printing.
vtkIdType IsHomogeneous() const override
Check if all cells have the same number of vertices.
void UpdateCellCount(int npts)
Used in conjunction with InsertNextCell(int npts) and InsertCellPoint() to update the number of point...
void Dispatch(Functor &&functor, Args &&... args) const
bool IsStorageFixedSize() const
static vtkCellArray * New()
Standard methods for instantiation, type information, and printing.
StorageTypes GetStorageType() const noexcept
ArrayType64 * GetOffsetsArray64() const
Return the array used to store cell offsets.
bool CanConvertToFixedSize32BitStorage() const
Check if the existing data can safely be converted to use 32- or 64- bit storage.
vtkTypeList::Create< ArrayType32, ArrayType64 > StorageArrayList
List of possible array types used for storage.
void Append(vtkCellArray *src, vtkIdType pointOffset=0)
Append cells from src into this.
bool IsStorage64Bit() const
ArrayType32 * GetOffsetsArray32() const
Return the array used to store cell offsets.
void ReplaceCellAtId(vtkIdType cellId, vtkIdType cellSize, const vtkIdType *cellPoints)
Replaces the point ids for the specified cell with the supplied list.
ArrayType64 * GetConnectivityArray64() const
Return the array used to store the point ids that define the cells' connectivity.
bool CanConvertTo64BitStorage() const
Check if the existing data can safely be converted to use 32- or 64- bit storage.
abstract class to specify cell behavior
vtkIdList * GetPointIds()
Return the list of point ids defining the cell.
abstract superclass for arrays of numeric data
list of point or cell ids
void SetNumberOfIds(vtkIdType number)
Specify the number of ids for this object to hold.
vtkIdType GetNumberOfIds() const noexcept
Return the number of id's in the list.
void Reset()
Reset to an empty state but retain previously allocated memory.
vtkIdType * GetPointer(vtkIdType i)
Get a pointer to a particular data index.
dynamic, self-adjusting array of vtkIdType
A read only array class that wraps an implicit function from integers to any value type supported by ...
a simple class to control print indentation
Allocate and hold a VTK object.
static vtkMallocingFunction GetCurrentMallocFunction()
static vtkFreeingFunction GetAlternateFreeFunction()
static bool GetUsingMemkind()
A global state flag that controls whether vtkObjects are constructed in the usual way (the default) o...
Hold a reference to a vtkObjectBase instance.
static vtkSmartPointer< T > New()
Create an instance of a VTK object.
typename detail::GetAPITypeImpl< ArrayType, ForceValueTypeForVtkDataArray >::APIType GetAPIType
vtkIdType GetNumberOfCells(OffsetsT *offsets)
static vtkIdType GetCellSize(OffsetsT *offsets, vtkIdType cellId)
static vtkIdType GetEndOffset(OffsetsT *offsets, vtkIdType cellId)
static decltype(vtk::DataArrayValueRange< 1, vtkIdType >(std::declval< ConnectivityT >())) GetCellRange(OffsetsT *offsets, ConnectivityT *conn, vtkIdType cellId)
static vtkIdType GetBeginOffset(OffsetsT *offsets, vtkIdType cellId)
static decltype(vtk::DataArrayValueRange< 1, vtkIdType >(std::declval< ArrayT >())) GetRange(ArrayT *array)
vtk::GetAPIType< ArrayT, vtkIdType > GetAPIType
vtkIdType GetNumberOfCells() const
vtkIdType GetEndOffset(vtkIdType cellId) const
vtkSmartPointer< ArrayType > Offsets
vtkSmartPointer< ArrayType > Connectivity
const ArrayType * GetOffsets() const
decltype(vtk::DataArrayValueRange< 1 >(std::declval< ArrayType >())) CellRangeType
CellRangeType GetCellRange(vtkIdType cellId)
vtkIdType GetBeginOffset(vtkIdType cellId) const
vtkIdType GetCellSize(vtkIdType cellId) const
const ArrayType * GetConnectivity() const
typename ArrayType::ValueType ValueType
ArrayType * GetConnectivity()
void operator()(OffsetsT *offsets, ConnectivityT *conn, vtkIdType cellId, vtkIdType cellPointIndex, vtkIdType &pointId)
void operator()(OffsetsT *offsets, ConnectivityT *conn, const vtkIdType cellId, vtkIdList *ids)
void operator()(OffsetsT *offsets, ConnectivityT *conn, const vtkIdType cellId, vtkIdType &cellSize, vtkIdType *cellPoints)
std::enable_if_t< CanShareConnPtr< ConnectivityT >::value, void > operator()(OffsetsT *offsets, ConnectivityT *conn, const vtkIdType cellId, vtkIdType &cellSize, vtkIdType const *&cellPoints, vtkIdList *temp)
std::enable_if_t<!CanShareConnPtr< ConnectivityT >::value, void > operator()(OffsetsT *offsets, ConnectivityT *conn, const vtkIdType cellId, vtkIdType &cellSize, vtkIdType const *&cellPoints, vtkIdList *temp)
void operator()(OffsetsT *offsets, ConnectivityT *conn, vtkIdType cellId, vtkIdType &cellSize)
void operator()(OffsetsT *offsets, ConnectivityT *conn, vtkIdType id)
void operator()(OffsetsT *offsets, ConnectivityT *conn, const vtkIdType npts, vtkIdType &cellId)
void operator()(OffsetsT *offsets, ConnectivityT *conn, const vtkIdType npts, const vtkIdType pts[], vtkIdType &cellId)
void operator()(OffsetsT *offsets, ConnectivityT *conn)
void operator()(OffsetsT *offsets, ConnectivityT *conn, const vtkIdType npts)
Efficient templated access to vtkDataArray.
Remove all duplicate types from TypeList TList, storing the new list in Result.
STL-compatible iterable ranges that provide access to vtkDataArray elements.
#define VTK_DEPRECATED_IN_9_6_0(reason)
#define VTK_SIZEHINT(...)
#define VTK_MARSHALMANUAL