127 #ifndef vtkCellArray_h
128 #define vtkCellArray_h
131 #include "vtkCommonDataModelModule.h"
140 #include "vtkFeatures.h"
142 #include "vtkTypeInt32Array.h"
143 #include "vtkTypeInt64Array.h"
147 #include <initializer_list>
148 #include <type_traits>
171 #define VTK_CELL_ARRAY_V2
173 VTK_ABI_NAMESPACE_BEGIN
195 void PrintDebug(ostream& os);
208 "Use vtkArrayDispatch::OffsetsArrays/ConnectivityArrays instead.") =
237 return this->AllocateExact(sz, sz) ? 1 : 0;
251 return this->AllocateExact(numCells, numCells * maxCellSize);
335 return static_cast<vtkIdType>(this->Offsets->GetComponent(cellId, 0));
343 this->Offsets->SetComponent(cellId, 0, static_cast<double>(offset));
351 return this->Connectivity->GetNumberOfValues();
375 void SetData(AOSArray32*, AOSArray32* connectivity);
376 void SetData(AOSArray64*, AOSArray64* connectivity);
377 void SetData(AffineArray32*, AOSArray32* connectivity);
378 void SetData(AffineArray64*, AOSArray64* connectivity);
455 return this->IsStorageFixedSize32Bit() || this->IsStorageFixedSize64Bit();
471 switch (this->StorageType)
473 case StorageTypes::Int32:
474 case StorageTypes::FixedSizeInt32:
475 return std::is_same_v<vtkTypeInt32, vtkIdType>;
476 case StorageTypes::Int64:
477 case StorageTypes::FixedSizeInt64:
478 return std::is_same_v<vtkTypeInt64, vtkIdType>;
479 case StorageTypes::Generic:
493 void Use32BitStorage();
494 void Use64BitStorage();
495 void UseDefaultStorage();
496 void UseFixedSize32BitStorage(
vtkIdType cellSize);
497 void UseFixedSize64BitStorage(
vtkIdType cellSize);
498 void UseFixedSizeDefaultStorage(
vtkIdType cellSize);
509 bool CanConvertTo32BitStorage()
const;
510 bool CanConvertTo64BitStorage()
const;
511 bool CanConvertToDefaultStorage()
const;
512 bool CanConvertToFixedSize32BitStorage()
const;
513 bool CanConvertToFixedSize64BitStorage()
const;
514 bool CanConvertToFixedSizeDefaultStorage()
const;
519 case StorageTypes::Int32:
520 return this->CanConvertTo32BitStorage();
521 case StorageTypes::Int64:
522 return this->CanConvertTo64BitStorage();
523 case StorageTypes::FixedSizeInt32:
524 return this->CanConvertToFixedSize32BitStorage();
525 case StorageTypes::FixedSizeInt64:
526 return this->CanConvertToFixedSize64BitStorage();
527 case StorageTypes::Generic:
550 bool ConvertTo32BitStorage();
551 bool ConvertTo64BitStorage();
552 bool ConvertToDefaultStorage();
553 bool ConvertToFixedSize32BitStorage();
554 bool ConvertToFixedSize64BitStorage();
555 bool ConvertToFixedSizeDefaultStorage();
556 bool ConvertToSmallestStorage();
561 case StorageTypes::Int32:
562 return this->ConvertTo32BitStorage();
563 case StorageTypes::Int64:
564 return this->ConvertTo64BitStorage();
565 case StorageTypes::FixedSizeInt32:
566 return this->ConvertToFixedSize32BitStorage();
567 case StorageTypes::FixedSizeInt64:
568 return this->ConvertToFixedSize64BitStorage();
569 case StorageTypes::Generic:
583 vtkTypeInt32Array* GetOffsetsArray32()
const
585 return vtkTypeInt32Array::FastDownCast(this->Offsets);
589 vtkTypeInt64Array* GetOffsetsArray64()
const
591 return vtkTypeInt64Array::FastDownCast(this->Offsets);
596 return AffineArray32::FastDownCast(this->Offsets);
600 return AffineArray64::FastDownCast(this->Offsets);
612 vtkTypeInt32Array* GetConnectivityArray32()
const
614 return vtkTypeInt32Array::FastDownCast(this->Connectivity);
618 return AOSArray32::FastDownCast(this->Connectivity);
621 vtkTypeInt64Array* GetConnectivityArray64()
const
623 return vtkTypeInt64Array::FastDownCast(this->Connectivity);
627 return AOSArray64::FastDownCast(this->Connectivity);
650 void InitTraversal();
692 VTK_EXPECTS(0 <= cellId && cellId < GetNumberOfCells()) override;
700 VTK_EXPECTS(0 <= cellId && cellId < GetNumberOfCells()) override;
711 VTK_EXPECTS(0 <= cellId && cellId < GetNumberOfCells()) override;
717 VTK_EXPECTS(0 <= cellId && cellId < GetNumberOfCells())
718 VTK_EXPECTS(0 <= cellPointIndex && cellPointIndex < this->GetCellSize(cellId));
751 return this->InsertNextCell(static_cast<vtkIdType>(cell.size()), cell.begin());
760 inline vtkIdType InsertNextCell(
int npts);
772 void UpdateCellCount(
int npts);
782 void SetTraversalCellId(
vtkIdType cellId);
821 this->ReplaceCellAtId(cellId, static_cast<vtkIdType>(cell.size()), cell.begin());
896 unsigned long GetActualMemorySize() const;
908 template <
class ArrayT>
911 template <
class OffsetsT>
914 return offsets->GetNumberOfValues() - 1;
917 template <
class ArrayT>
918 static decltype(vtk::DataArrayValueRange<1, vtkIdType>(std::declval<ArrayT>())) GetRange(
921 return vtk::DataArrayValueRange<1, vtkIdType>(array);
924 template <
class OffsetsT>
927 return static_cast<vtkIdType>(GetRange(offsets)[cellId]);
930 template <
class OffsetsT>
933 return static_cast<vtkIdType>(GetRange(offsets)[cellId + 1]);
936 template <
class OffsetsT>
939 auto offsetsRange = GetRange(offsets);
940 return static_cast<vtkIdType>(offsetsRange[cellId + 1] - offsetsRange[cellId]);
943 template <
class OffsetsT,
class ConnectivityT>
944 static decltype(vtk::DataArrayValueRange<1, vtkIdType>(std::declval<ConnectivityT>()))
945 GetCellRange(OffsetsT* offsets, ConnectivityT* conn,
vtkIdType cellId)
947 auto offsetsRange = GetRange(offsets);
948 return vtk::DataArrayValueRange<1, vtkIdType>(
949 conn, offsetsRange[cellId], offsetsRange[cellId + 1]);
1017 template <
typename Functor,
typename... Args>
1020 switch (this->StorageType)
1022 case StorageTypes::Int32:
1023 functor(static_cast<AOSArray32*>(this->Offsets.Get()),
1024 static_cast<AOSArray32*>(this->Connectivity.Get()), std::forward<Args>(args)...);
1026 case StorageTypes::Int64:
1027 functor(static_cast<AOSArray64*>(this->Offsets.Get()),
1028 static_cast<AOSArray64*>(this->Connectivity.Get()), std::forward<Args>(args)...);
1030 case StorageTypes::FixedSizeInt32:
1031 functor(static_cast<AffineArray32*>(this->Offsets.Get()),
1032 static_cast<AOSArray32*>(this->Connectivity.Get()), std::forward<Args>(args)...);
1034 case StorageTypes::FixedSizeInt64:
1035 functor(static_cast<AffineArray64*>(this->Offsets.Get()),
1036 static_cast<AOSArray64*>(this->Connectivity.Get()), std::forward<Args>(args)...);
1038 case StorageTypes::Generic:
1040 functor(this->Offsets.Get(), this->Connectivity.Get(), std::forward<Args>(args)...);
1044 template <
typename Functor,
typename... Args>
1047 switch (this->StorageType)
1049 case StorageTypes::Int32:
1050 functor(static_cast<AOSArray32*>(this->Offsets.Get()),
1051 static_cast<AOSArray32*>(this->Connectivity.Get()), std::forward<Args>(args)...);
1053 case StorageTypes::Int64:
1054 functor(static_cast<AOSArray64*>(this->Offsets.Get()),
1055 static_cast<AOSArray64*>(this->Connectivity.Get()), std::forward<Args>(args)...);
1057 case StorageTypes::FixedSizeInt32:
1058 functor(static_cast<AffineArray32*>(this->Offsets.Get()),
1059 static_cast<AOSArray32*>(this->Connectivity.Get()), std::forward<Args>(args)...);
1061 case StorageTypes::FixedSizeInt64:
1062 functor(static_cast<AffineArray64*>(this->Offsets.Get()),
1063 static_cast<AOSArray64*>(this->Connectivity.Get()), std::forward<Args>(args)...);
1065 case StorageTypes::Generic:
1067 functor(this->Offsets.Get(), this->Connectivity.Get(), std::forward<Args>(args)...);
1075 template <
typename ArrayT>
1080 using CellRangeType = decltype(vtk::DataArrayValueRange<1>(std::declval<ArrayType>()));
1104 CellRangeType GetCellRange(
vtkIdType cellId);
1113 this->
Offsets->InsertNextValue(0);
1116 this->IsInMemkind =
true;
1120 void*
operator new(
size_t nSize)
1123 #ifdef VTK_USE_MEMKIND
1130 void operator delete(
void* p)
1132 #ifdef VTK_USE_MEMKIND
1153 bool IsInMemkind =
false;
1157 template <
typename Functor,
typename... Args>
1158 using GetReturnType = decltype(std::declval<Functor>()(
1161 template <
typename Functor,
typename... Args>
1162 struct ReturnsVoid : std::is_same<GetReturnType<Functor, Args...>, void>
1236 template <
typename Functor,
typename... Args,
1237 typename =
typename std::enable_if<ReturnsVoid<Functor, Args...>
::value>
::type>
1239 void Visit(Functor&& functor, Args&&... args)
1241 switch (this->StorageType)
1243 case StorageTypes::Int32:
1246 state.
Offsets = AOSArray32::FastDownCast(this->Offsets);
1247 state.
Connectivity = AOSArray32::FastDownCast(this->Connectivity);
1248 functor(state, std::forward<Args>(args)...);
1251 case StorageTypes::Int64:
1254 state.
Offsets = AOSArray64::FastDownCast(this->Offsets);
1255 state.
Connectivity = AOSArray64::FastDownCast(this->Connectivity);
1256 functor(state, std::forward<Args>(args)...);
1259 case StorageTypes::FixedSizeInt32:
1260 case StorageTypes::FixedSizeInt64:
1261 case StorageTypes::Generic:
1264 vtkWarningMacro(
"Use Dispatch");
1270 template <
typename Functor,
typename... Args,
1271 typename =
typename std::enable_if<ReturnsVoid<Functor, Args...>
::value>
::type>
1273 void Visit(Functor&& functor, Args&&... args)
const
1275 switch (this->StorageType)
1277 case StorageTypes::Int32:
1280 state.
Offsets = AOSArray32::FastDownCast(this->Offsets);
1281 state.
Connectivity = AOSArray32::FastDownCast(this->Connectivity);
1282 functor(state, std::forward<Args>(args)...);
1285 case StorageTypes::Int64:
1288 state.
Offsets = AOSArray64::FastDownCast(this->Offsets);
1289 state.
Connectivity = AOSArray64::FastDownCast(this->Connectivity);
1290 functor(state, std::forward<Args>(args)...);
1293 case StorageTypes::FixedSizeInt32:
1294 case StorageTypes::FixedSizeInt64:
1295 case StorageTypes::Generic:
1298 vtkWarningMacro(
"Use Dispatch");
1304 template <
typename Functor,
typename... Args,
1305 typename =
typename std::enable_if<!ReturnsVoid<Functor, Args...>
::value>
::type>
1307 GetReturnType<Functor, Args...> Visit(Functor&& functor, Args&&... args)
1309 switch (this->StorageType)
1311 case StorageTypes::Int32:
1314 state.
Offsets = AOSArray32::FastDownCast(this->Offsets);
1315 state.
Connectivity = AOSArray32::FastDownCast(this->Connectivity);
1316 return functor(state, std::forward<Args>(args)...);
1318 case StorageTypes::Int64:
1321 state.
Offsets = AOSArray64::FastDownCast(this->Offsets);
1322 state.
Connectivity = AOSArray64::FastDownCast(this->Connectivity);
1323 return functor(state, std::forward<Args>(args)...);
1325 case StorageTypes::FixedSizeInt32:
1326 case StorageTypes::FixedSizeInt64:
1327 case StorageTypes::Generic:
1330 vtkWarningMacro(
"Use Dispatch");
1331 return GetReturnType<Functor, Args...>();
1335 template <
typename Functor,
typename... Args,
1336 typename =
typename std::enable_if<!ReturnsVoid<Functor, Args...>
::value>
::type>
1338 GetReturnType<Functor, Args...> Visit(Functor&& functor, Args&&... args)
const
1340 switch (this->StorageType)
1342 case StorageTypes::Int32:
1345 state.
Offsets = AOSArray32::FastDownCast(this->Offsets);
1346 state.
Connectivity = AOSArray32::FastDownCast(this->Connectivity);
1347 return functor(state, std::forward<Args>(args)...);
1349 case StorageTypes::Int64:
1352 state.
Offsets = AOSArray64::FastDownCast(this->Offsets);
1353 state.
Connectivity = AOSArray64::FastDownCast(this->Connectivity);
1354 return functor(state, std::forward<Args>(args)...);
1356 case StorageTypes::FixedSizeInt32:
1357 case StorageTypes::FixedSizeInt64:
1358 case StorageTypes::Generic:
1361 vtkWarningMacro(
"Use Dispatch");
1362 return GetReturnType<Functor, Args...>();
1367 #endif // __VTK_WRAP__
1391 virtual
void SetNumberOfCells(
vtkIdType);
1405 vtkIdType EstimateSize(vtkIdType numCells,
int maxPtsPerCell);
1416 vtkIdType GetSize();
1425 vtkIdType GetNumberOfConnectivityEntries();
1437 void GetCell(vtkIdType loc, vtkIdType& npts, const vtkIdType*& pts)
1447 void GetCell(vtkIdType loc,
vtkIdList* pts)
1448 VTK_EXPECTS(0 <= loc && loc < GetNumberOfConnectivityEntries());
1457 vtkIdType GetInsertLocation(
int npts);
1467 vtkIdType GetTraversalLocation();
1469 vtkIdType GetTraversalLocation(vtkIdType npts);
1471 void SetTraversalLocation(vtkIdType loc);
1482 void ReverseCell(vtkIdType loc)
VTK_EXPECTS(0 <= loc && loc < GetNumberOfConnectivityEntries());
1496 void ReplaceCell(vtkIdType loc,
int npts, const vtkIdType pts[])
1527 "Use ExportLegacyFormat, or GetOffsetsArray/GetConnectivityArray instead.")
1536 ~vtkCellArray() override;
1541 vtkIdType TraversalCellId{ 0 };
1552 template <
typename ArrayT>
1555 return this->Offsets->GetNumberOfValues() - 1;
1558 template <
typename ArrayT>
1561 return static_cast<vtkIdType>(this->Offsets->GetValue(cellId));
1564 template <
typename ArrayT>
1567 return static_cast<vtkIdType>(this->Offsets->GetValue(cellId + 1));
1570 template <
typename ArrayT>
1573 return this->GetEndOffset(cellId) - this->GetBeginOffset(cellId);
1576 template <
typename ArrayT>
1580 return vtk::DataArrayValueRange<1>(
1581 this->
GetConnectivity(), this->GetBeginOffset(cellId), this->GetEndOffset(cellId));
1583 VTK_ABI_NAMESPACE_END
1587 VTK_ABI_NAMESPACE_BEGIN
1592 template <
class OffsetsT,
class ConnectivityT>
1599 OffsetsAccessorType offsetsAccesor(offsets);
1600 ConnectivityAccessorType connAccesor(conn);
1602 cellId = offsets->GetNumberOfValues() - 1;
1604 offsetsAccesor.InsertNext(static_cast<ValueType>(conn->GetNumberOfValues() + npts));
1608 connAccesor.InsertNext(static_cast<ValueType>(pts[i]));
1613 template <
class OffsetsT,
class ConnectivityT>
1618 AccessorType offsetsAccesor(offsets);
1620 cellId = offsets->GetNumberOfValues() - 1;
1622 offsetsAccesor.InsertNext(static_cast<ValueType>(conn->GetNumberOfValues() + npts));
1629 template <
class OffsetsT,
class ConnectivityT>
1634 auto offsetsRange = GetRange(offsets);
1635 const ValueType cellBegin = offsetsRange[offsets->GetMaxId() - 1];
1636 offsetsRange[offsets->GetMaxId()] =
static_cast<ValueType
>(cellBegin + npts);
1642 template <
class OffsetsT,
class ConnectivityT>
1644 OffsetsT* offsets, ConnectivityT* vtkNotUsed(conn),
vtkIdType cellId,
vtkIdType& cellSize)
1646 cellSize = GetCellSize(offsets, cellId);
1652 template <
class OffsetsT,
class ConnectivityT>
1655 auto offsetsRange = GetRange(offsets);
1656 const auto& beginOffset = offsetsRange[cellId];
1657 const auto& endOffset = offsetsRange[cellId + 1];
1659 const auto cellConnectivity = GetRange(conn).begin() + beginOffset;
1664 for (
vtkIdType i = 0; i < cellSize; ++i)
1666 idPtr[i] =
static_cast<vtkIdType>(cellConnectivity[i]);
1670 template <
class OffsetsT,
class ConnectivityT>
1674 auto offsetsRange = GetRange(offsets);
1675 const auto& beginOffset = offsetsRange[cellId];
1676 const auto& endOffset = offsetsRange[cellId + 1];
1677 cellSize =
static_cast<vtkIdType>(endOffset - beginOffset);
1678 const auto cellConnectivity = GetRange(conn).begin() + beginOffset;
1681 for (
vtkIdType i = 0; i < cellSize; ++i)
1683 cellPoints[i] =
static_cast<vtkIdType>(cellConnectivity[i]);
1688 template <
typename ConnectivityT>
1692 std::is_base_of_v<vtkAOSDataArrayTemplate<vtkIdType>, ConnectivityT>;
1695 template <
class OffsetsT,
class ConnectivityT>
1700 auto offsetsRange = GetRange(offsets);
1701 const auto& beginOffset = offsetsRange[cellId];
1702 const auto& endOffset = offsetsRange[cellId + 1];
1703 cellSize =
static_cast<vtkIdType>(endOffset - beginOffset);
1705 cellPoints = conn->GetPointer(beginOffset);
1708 template <
class OffsetsT,
class ConnectivityT>
1713 auto offsetsRange = GetRange(offsets);
1714 const auto& beginOffset = offsetsRange[cellId];
1715 const auto& endOffset = offsetsRange[cellId + 1];
1716 cellSize =
static_cast<vtkIdType>(endOffset - beginOffset);
1717 const auto cellConnectivity = GetRange(conn).begin() + beginOffset;
1721 for (
vtkIdType i = 0; i < cellSize; ++i)
1723 tempPtr[i] =
static_cast<vtkIdType>(cellConnectivity[i]);
1726 cellPoints = tempPtr;
1732 template <
class OffsetsT,
class ConnectivityT>
1737 static_cast<vtkIdType>(GetRange(conn)[GetBeginOffset(offsets, cellId) + cellPointIndex]);
1743 template <
class OffsetsT,
class ConnectivityT>
1750 AccessorType accessor(offsets);
1751 ValueType firstOffset = 0;
1752 accessor.InsertNext(firstOffset);
1758 template <
class OffsetsT,
class ConnectivityT>
1763 AccessorType accessor(conn);
1764 accessor.InsertNext(static_cast<ValueType>(
id));
1768 VTK_ABI_NAMESPACE_END
1771 VTK_ABI_NAMESPACE_BEGIN
1781 if (this->TraversalCellId < this->GetNumberOfCells())
1783 this->GetCellAtId(this->TraversalCellId, npts, pts);
1784 ++this->TraversalCellId;
1894 VTK_ABI_NAMESPACE_END
1895 #endif // vtkCellArray.h
AffineArray32 * GetOffsetsAffineArray32() const
Return the array used to store cell offsets.
void operator()(OffsetsT *offsets, ConnectivityT *conn, const vtkIdType cellId, vtkIdType &cellSize, vtkIdType *cellPoints)
vtkIdType GetNumberOfOffsets() const override
Get the number of elements in the offsets array.
void operator()(OffsetsT *offsets, ConnectivityT *conn, vtkIdType cellId, vtkIdType &cellSize)
AOSArray64 * GetConnectivityAOSArray64() const
Return the array used to store the point ids that define the cells' connectivity. ...
void GetCellAtId(vtkIdType cellId, vtkIdType &cellSize, vtkIdType const *&cellPoints, vtkIdList *ptIds) override
Return the point ids for the cell at cellId.
static vtkFreeingFunction GetAlternateFreeFunction()
ArrayType * GetConnectivity()
vtkIdType GetNumberOfCells() const override
Get the number of cells in the array.
Remove all duplicate types from TypeList TList, storing the new list in Result.
decltype(vtk::DataArrayValueRange< 1 >(std::declval< ArrayType >())) CellRangeType
std::enable_if_t< CanShareConnPtr< ConnectivityT >::value, void > operator()(OffsetsT *offsets, ConnectivityT *conn, const vtkIdType cellId, vtkIdType &cellSize, vtkIdType const *&cellPoints, vtkIdList *temp)
vtkIdType GetCellPointAtId(vtkIdType cellId, vtkIdType cellPointIndex) const
Return the point id at cellPointIndex for the cell at cellId.
vtkIdType GetNumberOfCells(OffsetsT *offsets)
vtkDataArray * GetOffsetsArray() const
Return the array used to store cell offsets.
vtkIdType GetNumberOfCells() const
void InsertCellPoint(vtkIdType id)
Used in conjunction with InsertNextCell(npts) to add another point to the list of cells...
bool IsStorageShareable() const override
AOSArray32 * GetOffsetsAOSArray32() const
Return the array used to store cell offsets.
void operator()(OffsetsT *offsets, ConnectivityT *conn)
typename detail::GetAPITypeImpl< ArrayType, ForceValueTypeForVtkDataArray >::APIType GetAPIType
abstract object to represent cell connectivity
AOSArray32 * GetConnectivityAOSArray32() const
Return the array used to store the point ids that define the cells' connectivity. ...
void operator()(OffsetsT *offsets, ConnectivityT *conn, vtkIdType cellId, vtkIdType cellPointIndex, vtkIdType &pointId)
vtkNew< vtkIdTypeArray > LegacyData
void Reset()
Reset to an empty state but retain previously allocated memory.
virtual void ShallowCopy(vtkAbstractCellArray *ca)=0
Shallow copy ca into this cell array.
vtkSmartPointer< vtkDataArray > Offsets
vtkIdType GetCellSize(vtkIdType cellId) const override
Return the size of the cell at cellId.
bool ConvertToStorageType(StorageTypes type)
Convert internal data structures to use 32- or 64-bit storage.
virtual int GetMaxCellSize()=0
Returns the size of the largest cell.
vtkSmartPointer< ArrayType > Connectivity
const ArrayType * GetOffsets() const
static vtkIdType GetEndOffset(OffsetsT *offsets, vtkIdType cellId)
dynamic, self-adjusting array of vtkIdType
static bool GetDefaultStorageIs64Bit()
Control the default internal storage size.
static vtkSmartPointer< T > New()
Create an instance of a VTK object.
static vtkIdType GetCellSize(OffsetsT *offsets, vtkIdType cellId)
vtkIdType TraversalCellId
virtual void DeepCopy(vtkAbstractCellArray *ca)=0
Perform a deep copy (no reference counting) of the given cell array.
static vtkIdType GetBeginOffset(OffsetsT *offsets, vtkIdType cellId)
const ArrayType * GetConnectivity() const
StorageTypes GetStorageType() const noexcept
typename vtkTypeList::detail::CreateImpl< Ts... >::type Create
bool IsStorageFixedSize64Bit() const
vtkIdType GetNumberOfConnectivityIds() const override
Get the size of the connectivity array that stores the point ids.
bool AllocateCopy(vtkCellArray *other)
Pre-allocate memory in internal data structures to match the used size of the input vtkCellArray...
vtkTypeList::Create< vtkTypeInt32Array, vtkTypeInt64Array > StorageArrayList
List of possible array types used for storage.
abstract class to specify cell behavior
void operator()(OffsetsT *offsets, ConnectivityT *conn, const vtkIdType npts)
static void SetDefaultStorageIs64Bit(bool val)
Control the default internal storage size.
#define VTK_DEPRECATED_IN_9_6_0(reason)
#define VTK_MARSHALMANUAL
a simple class to control print indentation
void Dispatch(Functor &&functor, Args &&...args) const
static bool GetUsingMemkind()
A global state flag that controls whether vtkObjects are constructed in the usual way (the default) o...
void operator()(OffsetsT *offsets, ConnectivityT *conn, const vtkIdType npts, vtkIdType &cellId)
Array-Of-Structs implementation of vtkGenericDataArray.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
list of point or cell ids
abstract superclass for arrays of numeric data
vtkTypeList::Unique< vtkTypeList::Create< vtkAOSDataArrayTemplate< int >, vtkAOSDataArrayTemplate< long >, vtkAOSDataArrayTemplate< long long >>>::Result InputArrayList
List of possible ArrayTypes that are compatible with internal storage.
vtkTypeInt64Array ArrayType64
vtkIdType GetNumberOfIds() const noexcept
Return the number of id's in the list.
vtkIdType GetEndOffset(vtkIdType cellId) const
#define VTK_SIZEHINT(...)
void Dispatch(Functor &&functor, Args &&...args)
void operator()(OffsetsT *offsets, ConnectivityT *conn, const vtkIdType npts, const vtkIdType pts[], vtkIdType &cellId)
bool IsStorage64Bit() const
AffineArray64 * GetOffsetsAffineArray64() const
Return the array used to store cell offsets.
vtkSmartPointer< vtkDataArray > GetData(const Ioss::GroupingEntity *entity, const std::string &fieldname, Ioss::Transform *transform=nullptr, Cache *cache=nullptr, const std::string &cachekey=std::string())
Returns a VTK array for a given field (fieldname) on the chosen block (or set) entity.
void UpdateCellCount(int npts)
Used in conjunction with InsertNextCell(int npts) and InsertCellPoint() to update the number of point...
CellRangeType GetCellRange(vtkIdType cellId)
vtkIdType InsertNextCell(vtkCell *cell)
Insert a cell object.
bool IsStorageFixedSize32Bit() const
static bool DefaultStorageIs64Bit
void GetCellAtId(vtkIdType cellId, vtkIdType &cellSize, vtkIdType const *&cellPoints)
Return the point ids for the cell at cellId.
vtkSmartPointer< ArrayType > Offsets
std::enable_if_t<!CanShareConnPtr< ConnectivityT >::value, void > operator()(OffsetsT *offsets, ConnectivityT *conn, const vtkIdType cellId, vtkIdType &cellSize, vtkIdType const *&cellPoints, vtkIdList *temp)
object to represent cell connectivity
vtkTypeInt32Array ArrayType32
virtual vtkIdType GetNumberOfCells() const =0
Get the number of cells in the array.
virtual void Initialize()=0
Free any memory and reset to an empty state.
A utility array for wrapping affine functions in implicit arrays.
typename ArrayType::ValueType ValueType
vtkIdType GetCellSize(vtkIdType cellId) const
vtk::GetAPIType< ArrayT, vtkIdType > GetAPIType
void operator()(OffsetsT *offsets, ConnectivityT *conn, vtkIdType id)
vtkIdList * GetPointIds()
Return the list of point ids defining the cell.
void operator()(OffsetsT *offsets, ConnectivityT *conn, const vtkIdType cellId, vtkIdList *ids)
vtkDataArray * GetConnectivityArray() const
Return the array used to store the point ids that define the cells' connectivity. ...
virtual vtkIdType IsHomogeneous() const =0
Check if all cells have the same number of vertices.
bool CanConvertToStorageType(StorageTypes type) const
Check if the existing data can safely be converted to use 32- or 64- bit storage. ...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
vtkSmartPointer< vtkDataArray > Connectivity
AOSArray64 * GetOffsetsAOSArray64() const
Return the array used to store cell offsets.
static vtkMallocingFunction GetCurrentMallocFunction()
bool GetConnectivity(const Ioss::GroupingEntity *group_entity, vtkCellGrid *grid, vtkDGCell *meta, int ioss_cell_points, int spec_index=-1, const std::string &group_name=std::string(), vtkIOSSUtilities::Cache *cache=nullptr)
Read connectivity and possibly ghost-node markings into meta.
bool IsStorage32Bit() const
bool IsStorageFixedSize() const
vtkIdType GetBeginOffset(vtkIdType cellId) const
Efficient templated access to vtkDataArray.
void SetNumberOfIds(vtkIdType number)
Specify the number of ids for this object to hold.
vtkIdType GetOffset(vtkIdType cellId) override
Get the offset (into the connectivity) for a specified cell id.
Encapsulate traversal logic for vtkCellArray.
bool IsStorageGeneric() const
void SetOffset(vtkIdType cellId, vtkIdType offset)
Set the offset (into the connectivity) for a specified cell id.
STL-compatible iterable ranges that provide access to vtkDataArray elements.
bool AllocateEstimate(vtkIdType numCells, vtkIdType maxCellSize)
Pre-allocate memory in internal data structures.
int GetNextCell(vtkIdType &npts, vtkIdType const *&pts)
vtkIdType * GetPointer(vtkIdType i)
Get a pointer to a particular data index.