VTK  9.7.0
vtkCellArray.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
126
127#ifndef vtkCellArray_h
128#define vtkCellArray_h
129
130#include "vtkAbstractCellArray.h"
131#include "vtkCommonDataModelModule.h" // For export macro
132#include "vtkWrappingHints.h" // For VTK_MARSHALMANUAL
133
134#include "vtkAOSDataArrayTemplate.h" // Needed for inline methods
135#include "vtkAffineArray.h" // Needed for inline methods
136#include "vtkCell.h" // Needed for inline methods
137#include "vtkDataArrayAccessor.h" // Needed for inline methods
138#include "vtkDataArrayRange.h" // Needed for inline methods
139#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_6_0
140#include "vtkFeatures.h" // for VTK_USE_MEMKIND
141#include "vtkSmartPointer.h" // For vtkSmartPointer
142#include "vtkTypeInt32Array.h" // Needed for inline methods
143#include "vtkTypeInt64Array.h" // Needed for inline methods
144#include "vtkTypeList.h" // Needed for ArrayList definition
145
146#include <cassert> // Needed for assert
147#include <initializer_list> // Needed for API
148#include <type_traits> // Needed for std::is_same
149#include <utility> // Needed for std::forward
150
171#define VTK_CELL_ARRAY_V2
172
173VTK_ABI_NAMESPACE_BEGIN
175class vtkIdTypeArray;
176
177class VTKCOMMONDATAMODEL_EXPORT VTK_MARSHALMANUAL vtkCellArray : public vtkAbstractCellArray
178{
179public:
180 using ArrayType32 VTK_DEPRECATED_IN_9_6_0("Use AOSArray32 instead.") = vtkTypeInt32Array;
181 using ArrayType64 VTK_DEPRECATED_IN_9_6_0("Use AOSArray64 instead.") = vtkTypeInt64Array;
186
188
192 static vtkCellArray* New();
194 void PrintSelf(ostream& os, vtkIndent indent) override;
195 void PrintDebug(ostream& os);
197
199
208 "Use vtkArrayDispatch::OffsetsArrays/ConnectivityArrays instead.") =
209 vtkTypeList::Create<vtkTypeInt32Array, vtkTypeInt64Array>;
211
213
225
234 VTK_DEPRECATED_IN_9_6_0("Use AllocateEstimate or AllocateExact instead.")
235 vtkTypeBool Allocate(vtkIdType sz, vtkIdType vtkNotUsed(ext) = 1000)
236 {
237 return this->AllocateExact(sz, sz) ? 1 : 0;
238 }
239
249 bool AllocateEstimate(vtkIdType numCells, vtkIdType maxCellSize)
250 {
251 return this->AllocateExact(numCells, numCells * maxCellSize);
252 }
253
263 bool AllocateExact(vtkIdType numCells, vtkIdType connectivitySize);
264
274 bool AllocateCopy(vtkCellArray* other)
275 {
276 return this->AllocateExact(other->GetNumberOfCells(), other->GetNumberOfConnectivityIds());
277 }
278
288 bool ResizeExact(vtkIdType numCells, vtkIdType connectivitySize);
289
293 void Initialize() override;
294
298 void Reset();
299
305 void Squeeze();
306
317 bool IsValid();
318
322 vtkIdType GetNumberOfCells() const override { return this->Offsets->GetNumberOfValues() - 1; }
323
328 vtkIdType GetNumberOfOffsets() const override { return this->Offsets->GetNumberOfValues(); }
329
333 vtkIdType GetOffset(vtkIdType cellId) override
334 {
335 return static_cast<vtkIdType>(this->Offsets->GetComponent(cellId, 0));
336 }
337
341 void SetOffset(vtkIdType cellId, vtkIdType offset)
342 {
343 this->Offsets->SetComponent(cellId, 0, static_cast<double>(offset));
344 }
345
350 {
351 return this->Connectivity->GetNumberOfValues();
352 }
353
360
362
375 void SetData(AOSArray32*, AOSArray32* connectivity);
376 void SetData(AOSArray64*, AOSArray64* connectivity);
377 void SetData(AffineArray32*, AOSArray32* connectivity);
378 void SetData(AffineArray64*, AOSArray64* connectivity);
380
395 bool SetData(vtkDataArray* offsets, vtkDataArray* connectivity);
396
414 bool SetData(vtkIdType cellSize, vtkDataArray* connectivity);
415
422 Generic,
423 };
424
428 StorageTypes GetStorageType() const noexcept { return this->StorageType; }
429
433 bool IsStorage64Bit() const { return this->StorageType == StorageTypes::Int64; }
434
438 bool IsStorage32Bit() const { return this->StorageType == StorageTypes::Int32; }
439
444
449
453 bool IsStorageFixedSize() const
454 {
455 return this->IsStorageFixedSize32Bit() || this->IsStorageFixedSize64Bit();
456 }
457
461 bool IsStorageGeneric() const { return this->StorageType == StorageTypes::Generic; }
462
469 bool IsStorageShareable() const override
470 {
471 switch (this->StorageType)
472 {
475 return std::is_same_v<vtkTypeInt32, vtkIdType>;
478 return std::is_same_v<vtkTypeInt64, vtkIdType>;
480 default:
481 return false;
482 }
483 }
484
497 void UseFixedSize64BitStorage(vtkIdType cellSize);
500
516 {
517 switch (type)
518 {
520 return this->CanConvertTo32BitStorage();
522 return this->CanConvertTo64BitStorage();
528 default:
529 return true;
530 }
531 }
533
558 {
559 switch (type)
560 {
562 return this->ConvertTo32BitStorage();
564 return this->ConvertTo64BitStorage();
566 return this->ConvertToFixedSize32BitStorage();
568 return this->ConvertToFixedSize64BitStorage();
570 default:
571 return true;
572 }
573 }
575
581 vtkDataArray* GetOffsetsArray() const { return this->Offsets; }
582 VTK_DEPRECATED_IN_9_6_0("Use GetOffsetsAOSArray32() instead.")
583 vtkTypeInt32Array* GetOffsetsArray32() const
584 {
585 return vtkTypeInt32Array::FastDownCast(this->Offsets);
586 }
588 VTK_DEPRECATED_IN_9_6_0("Use GetOffsetsAOSArray64() instead.")
589 vtkTypeInt64Array* GetOffsetsArray64() const
590 {
591 return vtkTypeInt64Array::FastDownCast(this->Offsets);
593 AOSArray64* GetOffsetsAOSArray64() const { return AOSArray64::FastDownCast(this->Offsets); }
594 AffineArray32* GetOffsetsAffineArray32() const
595 {
597 }
598 AffineArray64* GetOffsetsAffineArray64() const
599 {
600 return AffineArray64::FastDownCast(this->Offsets);
601 }
603
611 VTK_DEPRECATED_IN_9_6_0("Use GetConnectivityAOSArray32() instead.")
612 vtkTypeInt32Array* GetConnectivityArray32() const
613 {
614 return vtkTypeInt32Array::FastDownCast(this->Connectivity);
615 }
616 AOSArray32* GetConnectivityAOSArray32() const
617 {
618 return AOSArray32::FastDownCast(this->Connectivity);
620 VTK_DEPRECATED_IN_9_6_0("Use GetConnectivityAOSArray64() instead.")
621 vtkTypeInt64Array* GetConnectivityArray64() const
622 {
623 return vtkTypeInt64Array::FastDownCast(this->Connectivity);
624 }
625 AOSArray64* GetConnectivityAOSArray64() const
626 {
627 return AOSArray64::FastDownCast(this->Connectivity);
628 }
630
639 vtkIdType IsHomogeneous() const override;
640
650 void InitTraversal();
651
666 int GetNextCell(vtkIdType& npts, vtkIdType const*& pts) VTK_SIZEHINT(pts, npts);
667
678 int GetNextCell(vtkIdList* pts);
679
690 inline void GetCellAtId(vtkIdType cellId, vtkIdType& cellSize, vtkIdType const*& cellPoints,
691 vtkIdList* ptIds) VTK_SIZEHINT(cellPoints, cellSize)
692 VTK_EXPECTS(0 <= cellId && cellId < GetNumberOfCells()) override;
693
699 inline void GetCellAtId(vtkIdType cellId, vtkIdList* pts)
700 VTK_EXPECTS(0 <= cellId && cellId < GetNumberOfCells()) override;
701
709 inline void GetCellAtId(vtkIdType cellId, vtkIdType& cellSize, vtkIdType* cellPoints)
710 VTK_SIZEHINT(cellPoints, cellSize)
711 VTK_EXPECTS(0 <= cellId && cellId < GetNumberOfCells()) override;
712
716 vtkIdType GetCellPointAtId(vtkIdType cellId, vtkIdType cellPointIndex) const
717 VTK_EXPECTS(0 <= cellId && cellId < GetNumberOfCells())
718 VTK_EXPECTS(0 <= cellPointIndex && cellPointIndex < this->GetCellSize(cellId));
719
723 vtkIdType GetCellSize(vtkIdType cellId) const override;
724
728 inline vtkIdType InsertNextCell(vtkCell* cell);
729
734 inline vtkIdType InsertNextCell(vtkIdType npts, const vtkIdType* pts) VTK_SIZEHINT(pts, npts);
735
741
749 vtkIdType InsertNextCell(const std::initializer_list<vtkIdType>& cell)
750 {
751 return this->InsertNextCell(static_cast<vtkIdType>(cell.size()), cell.begin());
752 }
753
760 inline vtkIdType InsertNextCell(int npts);
761
766 void InsertCellPoint(vtkIdType id);
767
772 void UpdateCellCount(int npts);
773
782 void SetTraversalCellId(vtkIdType cellId);
784
788 void ReverseCellAtId(vtkIdType cellId) VTK_EXPECTS(0 <= cellId && cellId < GetNumberOfCells());
789
798 void ReplaceCellAtId(vtkIdType cellId, vtkIdList* list);
799 void ReplaceCellAtId(vtkIdType cellId, vtkIdType cellSize, const vtkIdType* cellPoints)
800 VTK_EXPECTS(0 <= cellId && cellId < GetNumberOfCells()) VTK_SIZEHINT(cellPoints, cellSize);
802
810 void ReplaceCellPointAtId(vtkIdType cellId, vtkIdType cellPointIndex, vtkIdType newPointId);
811
819 void ReplaceCellAtId(vtkIdType cellId, const std::initializer_list<vtkIdType>& cell)
820 {
821 this->ReplaceCellAtId(cellId, static_cast<vtkIdType>(cell.size()), cell.begin());
822 }
823
828 int GetMaxCellSize() override;
829
833 void DeepCopy(vtkAbstractCellArray* ca) override;
834
838 void ShallowCopy(vtkAbstractCellArray* ca) override;
839
843 void Append(vtkCellArray* src, vtkIdType pointOffset = 0);
844
856
869 void ImportLegacyFormat(const vtkIdType* data, vtkIdType len) VTK_SIZEHINT(data, len);
871
883 void AppendLegacyFormat(vtkIdTypeArray* data, vtkIdType ptOffset = 0);
884 void AppendLegacyFormat(const vtkIdType* data, vtkIdType len, vtkIdType ptOffset = 0)
885 VTK_SIZEHINT(data, len);
887
896 unsigned long GetActualMemorySize() const;
897
898 // The following code is used to support
899
900 // The wrappers get understandably confused by some of the template code below
901#ifndef __VTK_WRAP__
902 /*
903 * Utilities class that every dispatch functor used with Dispatch() must inherit
904 * or optionally use its static methods.
905 */
906 struct DispatchUtilities
908 template <class ArrayT>
911 template <class OffsetsT>
912 vtkIdType GetNumberOfCells(OffsetsT* offsets)
913 {
914 return offsets->GetNumberOfValues() - 1;
915 }
917 template <class ArrayT>
918 static decltype(vtk::DataArrayValueRange<1, vtkIdType>(std::declval<ArrayT>())) GetRange(
919 ArrayT* array)
920 {
922 }
924 template <class OffsetsT>
925 static vtkIdType GetBeginOffset(OffsetsT* offsets, vtkIdType cellId)
926 {
927 return static_cast<vtkIdType>(GetRange(offsets)[cellId]);
928 }
930 template <class OffsetsT>
931 static vtkIdType GetEndOffset(OffsetsT* offsets, vtkIdType cellId)
932 {
933 return static_cast<vtkIdType>(GetRange(offsets)[cellId + 1]);
934 }
936 template <class OffsetsT>
937 static vtkIdType GetCellSize(OffsetsT* offsets, vtkIdType cellId)
938 {
939 auto offsetsRange = GetRange(offsets);
940 return static_cast<vtkIdType>(offsetsRange[cellId + 1] - offsetsRange[cellId]);
941 }
942
943 template <class OffsetsT, class ConnectivityT>
944 static decltype(vtk::DataArrayValueRange<1, vtkIdType>(std::declval<ConnectivityT>()))
945 GetCellRange(OffsetsT* offsets, ConnectivityT* conn, vtkIdType cellId)
946 {
947 auto offsetsRange = GetRange(offsets);
949 conn, offsetsRange[cellId], offsetsRange[cellId + 1]);
950 }
951 };
952
954
1017 template <typename Functor, typename... Args>
1018 void Dispatch(Functor&& functor, Args&&... args)
1019 {
1020 switch (this->StorageType)
1021 {
1023 functor(static_cast<AOSArray32*>(this->Offsets.Get()),
1024 static_cast<AOSArray32*>(this->Connectivity.Get()), std::forward<Args>(args)...);
1025 break;
1027 functor(static_cast<AOSArray64*>(this->Offsets.Get()),
1028 static_cast<AOSArray64*>(this->Connectivity.Get()), std::forward<Args>(args)...);
1029 break;
1031 functor(static_cast<AffineArray32*>(this->Offsets.Get()),
1032 static_cast<AOSArray32*>(this->Connectivity.Get()), std::forward<Args>(args)...);
1033 break;
1035 functor(static_cast<AffineArray64*>(this->Offsets.Get()),
1036 static_cast<AOSArray64*>(this->Connectivity.Get()), std::forward<Args>(args)...);
1037 break;
1039 default:
1040 functor(this->Offsets.Get(), this->Connectivity.Get(), std::forward<Args>(args)...);
1041 break;
1042 }
1044 template <typename Functor, typename... Args>
1045 void Dispatch(Functor&& functor, Args&&... args) const
1046 {
1047 switch (this->StorageType)
1048 {
1049 case StorageTypes::Int32:
1050 functor(static_cast<AOSArray32*>(this->Offsets.Get()),
1051 static_cast<AOSArray32*>(this->Connectivity.Get()), std::forward<Args>(args)...);
1052 break;
1053 case StorageTypes::Int64:
1054 functor(static_cast<AOSArray64*>(this->Offsets.Get()),
1055 static_cast<AOSArray64*>(this->Connectivity.Get()), std::forward<Args>(args)...);
1056 break;
1057 case StorageTypes::FixedSizeInt32:
1058 functor(static_cast<AffineArray32*>(this->Offsets.Get()),
1059 static_cast<AOSArray32*>(this->Connectivity.Get()), std::forward<Args>(args)...);
1060 break;
1061 case StorageTypes::FixedSizeInt64:
1062 functor(static_cast<AffineArray64*>(this->Offsets.Get()),
1063 static_cast<AOSArray64*>(this->Connectivity.Get()), std::forward<Args>(args)...);
1064 break;
1065 case StorageTypes::Generic:
1066 default:
1067 functor(this->Offsets.Get(), this->Connectivity.Get(), std::forward<Args>(args)...);
1068 break;
1069 }
1070 }
1072
1073 // Holds connectivity and offset arrays of the given ArrayType.
1074 // VTK_DEPRECATED_IN_9_6_0("Use DispatchUtilities")
1075 template <typename ArrayT>
1078 using ArrayType = ArrayT;
1079 using ValueType = typename ArrayType::ValueType;
1080 using CellRangeType = decltype(vtk::DataArrayValueRange<1>(std::declval<ArrayType>()));
1081
1082 // We can't just use is_same here, since binary compatible representations
1083 // (e.g. int and long) are distinct types. Instead, ensure that ValueType
1084 // is a signed integer the same size as vtkIdType.
1085 // If this value is true, ValueType pointers may be safely converted to
1086 // vtkIdType pointers via reinterpret cast.
1087 static constexpr bool ValueTypeIsSameAsIdType = std::is_integral<ValueType>::value &&
1088 std::is_signed<ValueType>::value && (sizeof(ValueType) == sizeof(vtkIdType));
1090 ArrayType* GetOffsets() { return this->Offsets; }
1091 const ArrayType* GetOffsets() const { return this->Offsets; }
1093 ArrayType* GetConnectivity() { return this->Connectivity; }
1094 const ArrayType* GetConnectivity() const { return this->Connectivity; }
1095
1096 vtkIdType GetNumberOfCells() const;
1097
1098 vtkIdType GetBeginOffset(vtkIdType cellId) const;
1099
1100 vtkIdType GetEndOffset(vtkIdType cellId) const;
1101
1102 vtkIdType GetCellSize(vtkIdType cellId) const;
1103
1105
1106 friend class vtkCellArray;
1108 protected:
1109 VisitState()
1110 {
1113 this->Offsets->InsertNextValue(0);
1115 {
1116 this->IsInMemkind = true;
1119 ~VisitState() = default;
1120 void* operator new(size_t nSize)
1121 {
1122 void* r;
1123#ifdef VTK_USE_MEMKIND
1125#else
1126 r = malloc(nSize);
1127#endif
1128 return r;
1129 }
1130 void operator delete(void* p)
1131 {
1132#ifdef VTK_USE_MEMKIND
1133 VisitState* a = static_cast<VisitState*>(p);
1134 if (a->IsInMemkind)
1135 {
1137 }
1138 else
1139 {
1140 free(p);
1141 }
1142#else
1143 free(p);
1144#endif
1149
1150 private:
1151 VisitState(const VisitState&) = delete;
1152 VisitState& operator=(const VisitState&) = delete;
1153 bool IsInMemkind = false;
1154 };
1155
1156private: // Helpers that allow Visit to return a value:
1157 template <typename Functor, typename... Args>
1158 using GetReturnType = decltype(std::declval<Functor>()(
1159 std::declval<VisitState<AOSArray32>&>(), std::declval<Args>()...));
1160
1161 template <typename Functor, typename... Args>
1162 struct ReturnsVoid : std::is_same<GetReturnType<Functor, Args...>, void>
1163 {
1164 };
1165
1166public:
1236 template <typename Functor, typename... Args,
1237 typename = typename std::enable_if<ReturnsVoid<Functor, Args...>::value>::type>
1238 VTK_DEPRECATED_IN_9_6_0("Use Dispatch instead")
1239 void Visit(Functor&& functor, Args&&... args)
1240 {
1241 switch (this->StorageType)
1242 {
1244 {
1248 functor(state, std::forward<Args>(args)...);
1249 break;
1250 }
1252 {
1256 functor(state, std::forward<Args>(args)...);
1257 break;
1258 }
1262 default:
1263 {
1264 vtkWarningMacro("Use Dispatch");
1265 break;
1266 }
1267 }
1268 }
1269
1270 template <typename Functor, typename... Args,
1271 typename = typename std::enable_if<ReturnsVoid<Functor, Args...>::value>::type>
1272 VTK_DEPRECATED_IN_9_6_0("Use Dispatch instead")
1273 void Visit(Functor&& functor, Args&&... args) const
1274 {
1275 switch (this->StorageType)
1276 {
1278 {
1282 functor(state, std::forward<Args>(args)...);
1283 break;
1284 }
1286 {
1290 functor(state, std::forward<Args>(args)...);
1291 break;
1292 }
1296 default:
1297 {
1298 vtkWarningMacro("Use Dispatch");
1299 break;
1300 }
1301 }
1302 }
1303
1304 template <typename Functor, typename... Args,
1305 typename = typename std::enable_if<!ReturnsVoid<Functor, Args...>::value>::type>
1306 VTK_DEPRECATED_IN_9_6_0("Use Dispatch instead")
1307 GetReturnType<Functor, Args...> Visit(Functor&& functor, Args&&... args)
1308 {
1309 switch (this->StorageType)
1310 {
1312 {
1316 return functor(state, std::forward<Args>(args)...);
1317 }
1319 {
1323 return functor(state, std::forward<Args>(args)...);
1324 }
1328 default:
1329 {
1330 vtkWarningMacro("Use Dispatch");
1331 return GetReturnType<Functor, Args...>();
1332 }
1333 }
1334 }
1335 template <typename Functor, typename... Args,
1336 typename = typename std::enable_if<!ReturnsVoid<Functor, Args...>::value>::type>
1337 VTK_DEPRECATED_IN_9_6_0("Use Dispatch instead")
1338 GetReturnType<Functor, Args...> Visit(Functor&& functor, Args&&... args) const
1339 {
1340 switch (this->StorageType)
1341 {
1343 {
1347 return functor(state, std::forward<Args>(args)...);
1348 }
1350 {
1354 return functor(state, std::forward<Args>(args)...);
1355 }
1359 default:
1360 {
1361 vtkWarningMacro("Use Dispatch");
1362 return GetReturnType<Functor, Args...>();
1363 }
1364 }
1365 }
1366
1367#endif // __VTK_WRAP__
1368
1370
1378 static void SetDefaultStorageIs64Bit(bool val) { vtkCellArray::DefaultStorageIs64Bit = val; }
1380
1381 //=================== Begin Legacy Methods ===================================
1382 // These should be deprecated at some point as they are confusing or very slow
1383
1390 VTK_DEPRECATED_IN_9_6_0("This call has no effect.")
1391 virtual void SetNumberOfCells(vtkIdType);
1392
1404 VTK_DEPRECATED_IN_9_6_0("Use AllocateEstimate directly instead.")
1405 vtkIdType EstimateSize(vtkIdType numCells, int maxPtsPerCell);
1406
1415 VTK_DEPRECATED_IN_9_6_0("Method incompatible with current internal storage.")
1417
1424 VTK_DEPRECATED_IN_9_6_0("Method incompatible with current internal storage.")
1426
1436 VTK_DEPRECATED_IN_9_6_0("Use GetCellAtId.")
1437 void GetCell(vtkIdType loc, vtkIdType& npts, const vtkIdType*& pts)
1438 VTK_EXPECTS(0 <= loc && loc < GetNumberOfConnectivityEntries()) VTK_SIZEHINT(pts, npts);
1439
1446 VTK_DEPRECATED_IN_9_6_0("Use GetCellAtId.")
1447 void GetCell(vtkIdType loc, vtkIdList* pts)
1448 VTK_EXPECTS(0 <= loc && loc < GetNumberOfConnectivityEntries());
1449
1456 VTK_DEPRECATED_IN_9_6_0("Use GetNumberOfCells.")
1457 vtkIdType GetInsertLocation(int npts);
1458
1466 VTK_DEPRECATED_IN_9_6_0("Use GetTraversalCellId.")
1468 VTK_DEPRECATED_IN_9_6_0("Use GetTraversalCellId.")
1470 VTK_DEPRECATED_IN_9_6_0("Use SetTraversalCellId.")
1473
1481 VTK_DEPRECATED_IN_9_6_0("Use ReverseCellAtId.")
1482 void ReverseCell(vtkIdType loc) VTK_EXPECTS(0 <= loc && loc < GetNumberOfConnectivityEntries());
1483
1495 VTK_DEPRECATED_IN_9_6_0("Use ReplaceCellAtId.")
1496 void ReplaceCell(vtkIdType loc, int npts, const vtkIdType pts[])
1497 VTK_EXPECTS(0 <= loc && loc < GetNumberOfConnectivityEntries()) VTK_SIZEHINT(pts, npts);
1498
1513 VTK_DEPRECATED_IN_9_6_0("Use ImportLegacyFormat or SetData instead.")
1514 void SetCells(vtkIdType ncells, vtkIdTypeArray* cells);
1515
1527 "Use ExportLegacyFormat, or GetOffsetsArray/GetConnectivityArray instead.")
1529
1530 //=================== End Legacy Methods =====================================
1531
1532 friend class vtkCellArrayIterator;
1534protected:
1535 vtkCellArray();
1536 ~vtkCellArray() override;
1542
1544
1545 static bool DefaultStorageIs64Bit;
1546
1547private:
1548 vtkCellArray(const vtkCellArray&) = delete;
1549 void operator=(const vtkCellArray&) = delete;
1550};
1551
1552template <typename ArrayT>
1554{
1555 return this->Offsets->GetNumberOfValues() - 1;
1556}
1557
1558template <typename ArrayT>
1560{
1561 return static_cast<vtkIdType>(this->Offsets->GetValue(cellId));
1562}
1563
1564template <typename ArrayT>
1566{
1567 return static_cast<vtkIdType>(this->Offsets->GetValue(cellId + 1));
1568}
1569
1570template <typename ArrayT>
1572{
1573 return this->GetEndOffset(cellId) - this->GetBeginOffset(cellId);
1574}
1575
1576template <typename ArrayT>
1579{
1581 this->GetConnectivity(), this->GetBeginOffset(cellId), this->GetEndOffset(cellId));
1582}
1583VTK_ABI_NAMESPACE_END
1584
1586{
1587VTK_ABI_NAMESPACE_BEGIN
1588
1590{
1591 // Insert full cell
1592 template <class OffsetsT, class ConnectivityT>
1593 void operator()(OffsetsT* offsets, ConnectivityT* conn, const vtkIdType npts,
1594 const vtkIdType pts[], vtkIdType& cellId)
1595 {
1596 using ValueType = GetAPIType<OffsetsT>;
1597 using OffsetsAccessorType = vtkDataArrayAccessor<OffsetsT>;
1598 using ConnectivityAccessorType = vtkDataArrayAccessor<ConnectivityT>;
1599 OffsetsAccessorType offsetsAccesor(offsets);
1600 ConnectivityAccessorType connAccesor(conn);
1601
1602 cellId = offsets->GetNumberOfValues() - 1;
1603
1604 offsetsAccesor.InsertNext(static_cast<ValueType>(conn->GetNumberOfValues() + npts));
1605
1606 for (vtkIdType i = 0; i < npts; ++i)
1607 {
1608 connAccesor.InsertNext(static_cast<ValueType>(pts[i]));
1609 }
1610 }
1611
1612 // Just update offset table (for incremental API)
1613 template <class OffsetsT, class ConnectivityT>
1614 void operator()(OffsetsT* offsets, ConnectivityT* conn, const vtkIdType npts, vtkIdType& cellId)
1615 {
1616 using ValueType = GetAPIType<OffsetsT>;
1617 using AccessorType = vtkDataArrayAccessor<OffsetsT>;
1618 AccessorType offsetsAccesor(offsets);
1619
1620 cellId = offsets->GetNumberOfValues() - 1;
1621
1622 offsetsAccesor.InsertNext(static_cast<ValueType>(conn->GetNumberOfValues() + npts));
1623 }
1624};
1625
1626// for incremental API:
1628{
1629 template <class OffsetsT, class ConnectivityT>
1630 void operator()(OffsetsT* offsets, ConnectivityT* vtkNotUsed(conn), const vtkIdType npts)
1631 {
1632 using ValueType = GetAPIType<OffsetsT>;
1633
1634 auto offsetsRange = GetRange(offsets);
1635 const ValueType cellBegin = offsetsRange[offsets->GetMaxId() - 1];
1636 offsetsRange[offsets->GetMaxId()] = static_cast<ValueType>(cellBegin + npts);
1637 }
1638};
1639
1641{
1642 template <class OffsetsT, class ConnectivityT>
1644 OffsetsT* offsets, ConnectivityT* vtkNotUsed(conn), vtkIdType cellId, vtkIdType& cellSize)
1645 {
1646 cellSize = GetCellSize(offsets, cellId);
1647 }
1648};
1649
1651{
1652 template <class OffsetsT, class ConnectivityT>
1653 void operator()(OffsetsT* offsets, ConnectivityT* conn, const vtkIdType cellId, vtkIdList* ids)
1654 {
1655 auto offsetsRange = GetRange(offsets);
1656 const auto& beginOffset = offsetsRange[cellId];
1657 const auto& endOffset = offsetsRange[cellId + 1];
1658 const vtkIdType cellSize = static_cast<vtkIdType>(endOffset - beginOffset);
1659 const auto cellConnectivity = GetRange(conn).begin() + beginOffset;
1660
1661 // ValueType differs from vtkIdType, so we have to copy into a temporary buffer:
1662 ids->SetNumberOfIds(cellSize);
1663 vtkIdType* idPtr = ids->GetPointer(0);
1664 for (vtkIdType i = 0; i < cellSize; ++i)
1665 {
1666 idPtr[i] = static_cast<vtkIdType>(cellConnectivity[i]);
1667 }
1668 }
1669
1670 template <class OffsetsT, class ConnectivityT>
1671 void operator()(OffsetsT* offsets, ConnectivityT* conn, const vtkIdType cellId,
1672 vtkIdType& cellSize, vtkIdType* cellPoints)
1673 {
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;
1679
1680 // ValueType differs from vtkIdType, so we have to copy into a temporary buffer:
1681 for (vtkIdType i = 0; i < cellSize; ++i)
1682 {
1683 cellPoints[i] = static_cast<vtkIdType>(cellConnectivity[i]);
1684 }
1685 }
1686
1687 // SFINAE helper to check if a Functors's connectivity array's memory can be used as a vtkIdType*.
1688 template <typename ConnectivityT>
1690 {
1691 static constexpr bool value =
1692 std::is_base_of_v<vtkAOSDataArrayTemplate<vtkIdType>, ConnectivityT>;
1693 };
1694
1695 template <class OffsetsT, class ConnectivityT>
1696 typename std::enable_if_t<CanShareConnPtr<ConnectivityT>::value, void> operator()(
1697 OffsetsT* offsets, ConnectivityT* conn, const vtkIdType cellId, vtkIdType& cellSize,
1698 vtkIdType const*& cellPoints, vtkIdList* vtkNotUsed(temp))
1699 {
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);
1704 // This is safe, see CanShareConnPtr helper above.
1705 cellPoints = conn->GetPointer(beginOffset);
1706 }
1707
1708 template <class OffsetsT, class ConnectivityT>
1709 typename std::enable_if_t<!CanShareConnPtr<ConnectivityT>::value, void> operator()(
1710 OffsetsT* offsets, ConnectivityT* conn, const vtkIdType cellId, vtkIdType& cellSize,
1711 vtkIdType const*& cellPoints, vtkIdList* temp)
1712 {
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;
1718
1719 temp->SetNumberOfIds(cellSize);
1720 vtkIdType* tempPtr = temp->GetPointer(0);
1721 for (vtkIdType i = 0; i < cellSize; ++i)
1722 {
1723 tempPtr[i] = static_cast<vtkIdType>(cellConnectivity[i]);
1724 }
1725
1726 cellPoints = tempPtr;
1727 }
1728};
1729
1731{
1732 template <class OffsetsT, class ConnectivityT>
1733 void operator()(OffsetsT* offsets, ConnectivityT* conn, vtkIdType cellId,
1734 vtkIdType cellPointIndex, vtkIdType& pointId)
1735 {
1736 pointId =
1737 static_cast<vtkIdType>(GetRange(conn)[GetBeginOffset(offsets, cellId) + cellPointIndex]);
1738 }
1739};
1740
1742{
1743 template <class OffsetsT, class ConnectivityT>
1744 void operator()(OffsetsT* offsets, ConnectivityT* conn)
1745 {
1746 using ValueType = GetAPIType<OffsetsT>;
1747 using AccessorType = vtkDataArrayAccessor<OffsetsT>;
1748 offsets->Reset();
1749 conn->Reset();
1750 AccessorType accessor(offsets);
1751 ValueType firstOffset = 0;
1752 accessor.InsertNext(firstOffset);
1753 }
1754};
1755
1757{
1758 template <class OffsetsT, class ConnectivityT>
1759 void operator()(OffsetsT* vtkNotUsed(offsets), ConnectivityT* conn, vtkIdType id)
1760 {
1761 using ValueType = GetAPIType<ConnectivityT>;
1762 using AccessorType = vtkDataArrayAccessor<ConnectivityT>;
1763 AccessorType accessor(conn);
1764 accessor.InsertNext(static_cast<ValueType>(id));
1765 }
1766};
1767
1768VTK_ABI_NAMESPACE_END
1769} // end namespace vtkCellArray_detail
1770
1771VTK_ABI_NAMESPACE_BEGIN
1772//----------------------------------------------------------------------------
1774{
1775 this->TraversalCellId = 0;
1776}
1777
1778//----------------------------------------------------------------------------
1779inline int vtkCellArray::GetNextCell(vtkIdType& npts, vtkIdType const*& pts) VTK_SIZEHINT(pts, npts)
1780{
1781 if (this->TraversalCellId < this->GetNumberOfCells())
1782 {
1783 this->GetCellAtId(this->TraversalCellId, npts, pts);
1784 ++this->TraversalCellId;
1785 return 1;
1786 }
1787
1788 npts = 0;
1789 pts = nullptr;
1790 return 0;
1791}
1792
1793//----------------------------------------------------------------------------
1795{
1797 {
1798 this->GetCellAtId(this->TraversalCellId, pts);
1799 ++this->TraversalCellId;
1800 return 1;
1801 }
1802
1803 pts->Reset();
1804 return 0;
1805}
1806//----------------------------------------------------------------------------
1808{
1809 vtkIdType cellSize;
1810 this->Dispatch(vtkCellArray_detail::GetCellSizeImpl{}, cellId, cellSize);
1811 return cellSize;
1812}
1813
1814//----------------------------------------------------------------------------
1815void vtkCellArray::GetCellAtId(vtkIdType cellId, vtkIdType& cellSize, vtkIdType const*& cellPoints,
1816 vtkIdList* ptIds) VTK_SIZEHINT(cellPoints, cellSize)
1817{
1818 this->Dispatch(vtkCellArray_detail::GetCellAtIdImpl{}, cellId, cellSize, cellPoints, ptIds);
1819}
1820
1821//----------------------------------------------------------------------------
1823{
1824 this->Dispatch(vtkCellArray_detail::GetCellAtIdImpl{}, cellId, pts);
1825}
1826
1827//----------------------------------------------------------------------------
1828void vtkCellArray::GetCellAtId(vtkIdType cellId, vtkIdType& cellSize, vtkIdType* cellPoints)
1829{
1830 this->Dispatch(vtkCellArray_detail::GetCellAtIdImpl{}, cellId, cellSize, cellPoints);
1831}
1832
1833//----------------------------------------------------------------------------
1835{
1836 vtkIdType pointId;
1837 this->Dispatch(vtkCellArray_detail::CellPointAtIdImpl{}, cellId, cellPointIndex, pointId);
1838 return pointId;
1839}
1840
1841//----------------------------------------------------------------------------
1843{
1844 vtkIdType cellId;
1845 this->Dispatch(vtkCellArray_detail::InsertNextCellImpl{}, npts, pts, cellId);
1846 return cellId;
1847}
1848
1849//----------------------------------------------------------------------------
1851{
1852 vtkIdType cellId;
1854 return cellId;
1855}
1856
1857//----------------------------------------------------------------------------
1859{
1861}
1862
1863//----------------------------------------------------------------------------
1865{
1867}
1868
1869//----------------------------------------------------------------------------
1871{
1872 vtkIdType cellId;
1873 this->Dispatch(
1875 return cellId;
1876}
1877
1878//----------------------------------------------------------------------------
1880{
1881 vtkIdList* pts = cell->GetPointIds();
1882 vtkIdType cellId;
1883 this->Dispatch(
1885 return cellId;
1886}
1887
1888//----------------------------------------------------------------------------
1890{
1892}
1893
1894VTK_ABI_NAMESPACE_END
1895#endif // vtkCellArray.h
Array-Of-Structs implementation of vtkGenericDataArray.
void GetCellAtId(vtkIdType cellId, vtkIdType &cellSize, vtkIdType const *&cellPoints)
Return the point ids for the cell at cellId.
A utility array for wrapping affine functions in implicit arrays.
static vtkAffineArray< ValueType > * FastDownCast(vtkAbstractArray *source)
Encapsulate traversal logic for vtkCellArray.
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.
vtkTypeList::Unique< vtkTypeList::Create< vtkAOSDataArrayTemplate< int >, vtkAOSDataArrayTemplate< long >, vtkAOSDataArrayTemplate< long long > > >::Result InputArrayList
List of possible ArrayTypes that are compatible with internal storage.
int GetNextCell(vtkIdType &npts, vtkIdType const *&pts)
vtkIdTypeArray * GetData()
Return the underlying data as a data array.
void UseFixedSizeDefaultStorage(vtkIdType cellSize)
Initialize internal data structures to use 32- or 64-bit storage.
vtkIdType GetOffset(vtkIdType cellId) override
Get the offset (into the connectivity) for a specified cell id.
vtkIdType GetNumberOfConnectivityEntries()
Return the size of the array that would be returned from ExportLegacyFormat().
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.:
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.
friend class vtkCellArrayIterator
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 ReplaceCell(vtkIdType loc, int npts, const vtkIdType pts[])
Replace the point ids of the cell at the legacy location with a different list of point ids.
vtkIdType GetTraversalCellId()
Get/Set the current cellId for traversal.
void Visit(Functor &&functor, Args &&... args)
vtkTypeInt32Array ArrayType32
vtkIdType GetNumberOfCells() const override
Get the number of cells in the array.
void Reset()
Reuse list.
vtkAOSDataArrayTemplate< vtkTypeInt32 > AOSArray32
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.
vtkIdType GetTraversalLocation()
Get/Set the current traversal legacy location.
vtkAOSDataArrayTemplate< vtkTypeInt64 > AOSArray64
bool CanConvertToStorageType(StorageTypes type) const
Check if the existing data can safely be converted to use 32- or 64- bit storage.
void SetData(AffineArray32 *, AOSArray32 *connectivity)
Set the internal data arrays to the supplied offsets and connectivity arrays.
bool ConvertToFixedSize64BitStorage()
Convert internal data structures to use 32- or 64-bit storage.
vtkAffineArray< vtkTypeInt64 > AffineArray64
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...
vtkIdType EstimateSize(vtkIdType numCells, int maxPtsPerCell)
Utility routines help manage memory of cell array.
bool AllocateEstimate(vtkIdType numCells, vtkIdType maxCellSize)
Pre-allocate memory in internal data structures.
void ReverseCell(vtkIdType loc)
Special method inverts ordering of cell at the specified legacy location.
vtkTypeInt64Array ArrayType64
vtkIdType TraversalCellId
void UseFixedSize64BitStorage(vtkIdType cellSize)
Initialize internal data structures to use 32- or 64-bit storage.
void InitTraversal()
bool IsStorageShareable() const override
bool IsStorageGeneric() const
void Use64BitStorage()
Initialize internal data structures to use 32- or 64-bit storage.
vtkSmartPointer< vtkDataArray > Offsets
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
void GetCell(vtkIdType loc, vtkIdType &npts, const vtkIdType *&pts)
Internal method used to retrieve a cell given a legacy offset location.
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 SetData(AffineArray64 *, AOSArray64 *connectivity)
Set the internal data arrays to the supplied offsets and connectivity arrays.
void InsertCellPoint(vtkIdType id)
Used in conjunction with InsertNextCell(npts) to add another point to the list of cells.
unsigned long GetActualMemorySize() const
Return the memory in kibibytes (1024 bytes) consumed by this cell array.
vtkCellArrayIterator * NewIterator()
NewIterator returns a new instance of vtkCellArrayIterator that is initialized to point at the first ...
void SetTraversalLocation(vtkIdType loc)
Get/Set the current traversal legacy location.
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 Initialize() override
Free any memory and reset to an empty state.
void Squeeze()
Reclaim any extra memory while preserving data.
vtkSmartPointer< vtkDataArray > Connectivity
bool IsStorageFixedSize32Bit() const
bool ConvertTo32BitStorage()
Convert internal data structures to use 32- or 64-bit storage.
vtkTypeBool Allocate(vtkIdType sz, vtkIdType ext=1000)
Allocate memory.
bool ConvertToFixedSizeDefaultStorage()
Convert internal data structures to use 32- or 64-bit storage.
void SetData(AOSArray32 *, AOSArray32 *connectivity)
Set the internal data arrays to the supplied offsets and connectivity arrays.
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.
vtkTypeList::Create< vtkTypeInt32Array, vtkTypeInt64Array > StorageArrayList
List of possible array types used for 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 ImportLegacyFormat(vtkIdTypeArray *data)
Import an array of data with the legacy vtkCellArray layout, e.g.:
vtkAffineArray< vtkTypeInt32 > AffineArray32
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.
bool IsStorageFixedSize64Bit() const
static bool GetDefaultStorageIs64Bit()
Control the default internal storage size.
StorageTypes StorageType
int GetMaxCellSize() override
Returns the size of the largest cell.
vtkIdType InsertNextCell(vtkCell *cell)
Insert a cell object.
virtual void SetNumberOfCells(vtkIdType)
Set the number of cells in the array.
vtkNew< vtkIdTypeArray > LegacyData
void Dispatch(Functor &&functor, Args &&... args)
AOSArray32 * GetOffsetsAOSArray32() const
Return the array used to store cell offsets.
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.
vtkIdType GetInsertLocation(int npts)
Computes the current legacy insertion location within the internal array.
void UpdateCellCount(int npts)
Used in conjunction with InsertNextCell(int npts) and InsertCellPoint() to update the number of point...
bool IsStorageFixedSize() const
void SetCells(vtkIdType ncells, vtkIdTypeArray *cells)
Define multiple cells by providing a connectivity list.
static vtkCellArray * New()
Standard methods for instantiation, type information, and printing.
StorageTypes GetStorageType() const noexcept
void ReplaceCellPointAtId(vtkIdType cellId, vtkIdType cellPointIndex, vtkIdType newPointId)
Replaces the pointId at cellPointIndex of a cell with newPointId.
vtkIdType GetSize()
Get the size of the allocated connectivity array.
bool CanConvertToFixedSize32BitStorage() const
Check if the existing data can safely be converted to use 32- or 64- bit storage.
void Append(vtkCellArray *src, vtkIdType pointOffset=0)
Append cells from src into this.
bool IsStorage64Bit() const
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
Definition vtkCell.h:51
vtkIdList * GetPointIds()
Return the list of point ids defining the cell.
Definition vtkCell.h:144
static vtkDataArray * FastDownCast(vtkAbstractArray *source)
Perform a fast, safe cast from a vtkAbstractArray to a vtkDataArray.
list of point or cell ids
Definition vtkIdList.h:26
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.
Definition vtkIdList.h:76
void Reset()
Reset to an empty state but retain previously allocated memory.
Definition vtkIdList.h:186
vtkIdType * GetPointer(vtkIdType i)
Get a pointer to a particular data index.
Definition vtkIdList.h:150
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
Definition vtkIndent.h:29
Allocate and hold a VTK object.
Definition vtkNew.h:59
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
VTK_ITER_INLINE auto DataArrayValueRange(const ArrayTypePtr &array, ValueIdType start=-1, ValueIdType end=-1) -> typename detail::SelectValueRange< ArrayTypePtr, TupleSize, ForceValueTypeForVtkDataArray >::type
Generate an stl and for-range compatible range of flat AOS iterators from a vtkDataArray.
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
static constexpr bool ValueTypeIsSameAsIdType
decltype(vtk::DataArrayValueRange< 1 >(std::declval< ArrayType >())) CellRangeType
CellRangeType GetCellRange(vtkIdType cellId)
vtkIdType GetBeginOffset(vtkIdType cellId) const
vtkIdType GetCellSize(vtkIdType cellId) 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.
int vtkTypeBool
Definition vtkABI.h:64
#define vtkDataArray
STL-compatible iterable ranges that provide access to vtkDataArray elements.
#define VTK_DEPRECATED_IN_9_6_0(reason)
int vtkIdType
Definition vtkType.h:363
#define VTK_SIZEHINT(...)
#define VTK_EXPECTS(x)
#define VTK_MARSHALMANUAL
#define VTK_NEWINSTANCE