99#ifndef vtkPolyhedronCellArray_h
100#define vtkPolyhedronCellArray_h
102#include "vtkCommonDataModelModule.h"
110#include <type_traits>
113VTK_ABI_NAMESPACE_BEGIN
220 const StorageTypes storageType = this->Faces->GetStorageType();
221 return storageType == this->FaceLocations->GetStorageType() ? storageType
222 : StorageTypes::Generic;
418 template <typename Functor, typename... Args>
419 decltype(auto)
Dispatch(Functor&& functor, Args&&... args)
const
422 std::forward<Functor>(functor), this->
GetStorageType(), std::forward<Args>(args)...);
424 template <
typename Functor,
typename... Args>
431 case StorageTypes::Int32:
436 case StorageTypes::Int64:
441 case StorageTypes::FixedSizeInt32:
446 case StorageTypes::FixedSizeInt64:
451 case StorageTypes::Generic:
455 std::forward<Args>(args)...);
474VTK_ABI_NAMESPACE_BEGIN
477 template <
class FaceOffsetsT,
class FaceConnectivityT,
class LocationOffsetsT,
478 class LocationConnectivityT>
479 int operator()(FaceOffsetsT*, FaceConnectivityT*, LocationOffsetsT* locationOffsets,
480 LocationConnectivityT*,
vtkIdType cellId)
const
482 return static_cast<int>(
488template <
class LocationOffsetsT,
class LocationConnectivityT>
493 return static_cast<vtkIdType>(Utilities::GetRange(
494 locationConnectivity)[Utilities::GetBeginOffset(locationOffsets, cellId) + face]);
499 template <
class FaceOffsetsT,
class FaceConnectivityT,
class LocationOffsetsT,
500 class LocationConnectivityT>
502 LocationConnectivityT* locationConnectivity,
vtkIdType cellId,
int face)
const
504 return GetFaceId(locationOffsets, locationConnectivity, cellId, face);
510 template <
class FaceOffsetsT,
class FaceConnectivityT,
class LocationOffsetsT,
511 class LocationConnectivityT>
513 LocationOffsetsT* locationOffsets, LocationConnectivityT* locationConnectivity,
516 const vtkIdType faceId =
GetFaceId(locationOffsets, locationConnectivity, cellId, face);
525 template <
class FaceOffsetsT,
class FaceConnectivityT,
class LocationOffsetsT,
526 class LocationConnectivityT>
528 LocationOffsetsT* locationOffsets, LocationConnectivityT* locationConnectivity,
531 const vtkIdType faceId =
GetFaceId(locationOffsets, locationConnectivity, cellId, face);
534 if constexpr (std::is_base_of_v<vtkAOSDataArrayTemplate<vtkIdType>, FaceConnectivityT>)
537 pts = faceConnectivity->GetPointer(begin);
543 const auto facePoints =
GetRange(faceConnectivity).begin() + begin;
546 ids[i] =
static_cast<vtkIdType>(facePoints[i]);
556VTK_ABI_NAMESPACE_BEGIN
object to represent cell connectivity
vtkDataArray * GetOffsetsArray() const
Return the array used to store cell offsets.
vtkAOSDataArrayTemplate< vtkTypeInt32 > AOSArray32
vtkAOSDataArrayTemplate< vtkTypeInt64 > AOSArray64
vtkAffineArray< vtkTypeInt64 > AffineArray64
vtkDataArray * GetConnectivityArray() const
Return the array used to store the point ids that define the cells' connectivity.
vtkAffineArray< vtkTypeInt32 > AffineArray32
list of point or cell ids
void SetNumberOfIds(vtkIdType number)
Specify the number of ids for this object to hold.
vtkIdType * GetPointer(vtkIdType i)
Get a pointer to a particular data index.
dynamic, self-adjusting array of vtkIdType
a simple class to control print indentation
int GetMaxCellNumberOfFaces() const
Return the number of faces of the cell with the most faces.
void Initialize()
Free any memory and reset to an empty state.
vtkIdType GetNumberOfCells() const
Get the number of cells, and the number of faces of all the cells.
int GetCellNumberOfFaces(vtkIdType cellId) const
Return the number of faces of the cell cellId.
bool ConvertToSmallestStorage()
Convert the storage of Faces and FaceLocations, see vtkCellArray.
vtkIdType GetCellNumberOfFacePoints(vtkIdType cellId) const
Return the number of points of all the faces of the cell cellId, as listed in its faces: a point of s...
vtkCellArray::AffineArray64 AffineArray64
vtkCellArray::StorageTypes StorageTypes
StorageTypes GetStorageType() const noexcept
Return the storage type of the arrays: the one of Faces and FaceLocations if they have the same,...
vtkIdType InsertEmptyCells(vtkIdType numCells)
Insert numCells cells without face, e.g., the cells of a vtkUnstructuredGrid that are not polyhedral.
void Append(vtkPolyhedronCellArray *source, vtkIdType pointOffset=0)
Append the cells of source into this, as vtkCellArray::Append(): the point ids of its faces are offse...
bool IsStorageShareable() const
Return true if the points of the faces are stored as vtkIdType, so that GetFacePoints() returns a poi...
bool ConvertTo64BitStorage()
Convert the storage of Faces and FaceLocations, see vtkCellArray.
void Reset()
Reuse the list without freeing memory.
void DeepCopy(vtkPolyhedronCellArray *other)
Perform a deep copy (no reference counting) of the given polyhedron cell array.
decltype(auto) Dispatch(Functor &&functor, StorageTypes storageType, Args &&... args) const
~vtkPolyhedronCellArray() override
bool ImportLegacyFormat(const vtkIdType *faces, vtkIdType facesLength, const vtkIdType *faceLocations, vtkIdType numberOfCells)
Import arrays of data with the legacy layout of the faces of the cells, see ExportLegacyFormat(): fac...
void GetFaceStream(vtkIdType cellId, vtkIdList *faceStream) const
Copy the faces of the cell cellId into faceStream, as a face stream preceded by the number of faces: ...
bool AppendLegacyFormat(vtkIdTypeArray *faces, vtkIdTypeArray *faceLocations, vtkIdType ptOffset=0)
Append arrays of data with the legacy layout of the faces of the cells, see ExportLegacyFormat() and ...
VTK_WRAPEXCLUDE vtkIdType InsertNextCell(vtkIdType numFaces, const vtkIdType *faceStream)
Insert a cell given by its numFaces faces, as a face stream: (numFace0Pts, id1, id2,...
bool ImportLegacyFormat(vtkIdTypeArray *faces, vtkIdTypeArray *faceLocations)
Import arrays of data with the legacy layout of the faces of the cells, see ExportLegacyFormat(): fac...
void GetFacePoints(vtkIdType cellId, int face, vtkIdType &npts, vtkIdType const *&pts, vtkIdList *tempIds) const
Return the npts point ids pts of the face face of the cell cellId, as vtkCellArray::GetCellAtId(): pt...
int GetMaxFaceSize() const
Return the size of the largest face, i.e., its number of points.
vtkCellArray * GetFaces() const
Return the vtkCellArray of the faces, whose cells are the point ids of the faces, and the vtkCellArra...
vtkIdType InsertNextCell(vtkCellArray *faces)
Insert a cell given by its faces, one cell of faces per face.
bool AllocateEstimate(vtkIdType numCells, vtkIdType maxFacesPerCell, vtkIdType maxFacePoints)
Pre-allocate memory to store numCells cells of at most maxFacesPerCell faces of at most maxFacePoints...
vtkIdType GetNumberOfFaces() const
Get the number of cells, and the number of faces of all the cells.
vtkCellArray::AOSArray32 AOSArray32
static vtkPolyhedronCellArray * New()
Standard methods for instantiation, type information, and printing.
void GetFacePoints(vtkIdType cellId, int face, vtkIdList *pts) const
Copy the point ids of the face face of the cell cellId into pts.
bool ConvertToDefaultStorage()
Convert the storage of Faces and FaceLocations, see vtkCellArray.
vtkCellArray::AOSArray64 AOSArray64
bool ConvertTo32BitStorage()
Convert the storage of Faces and FaceLocations, see vtkCellArray.
bool AppendLegacyFormat(const vtkIdType *faces, vtkIdType facesLength, const vtkIdType *faceLocations, vtkIdType numberOfCells, vtkIdType ptOffset=0)
Append arrays of data with the legacy layout of the faces of the cells, see ExportLegacyFormat() and ...
void SetData(vtkCellArray *faces, vtkCellArray *faceLocations)
Set the internal data arrays to the supplied faces and face locations, which are referenced,...
void GetCellFaces(vtkIdType cellId, vtkCellArray *faces) const
Copy the faces of the cell cellId into faces, one cell per face.
vtkCellArray * GetFaceLocations() const
Return the vtkCellArray of the faces, whose cells are the point ids of the faces, and the vtkCellArra...
unsigned long GetActualMemorySize() const
Return the size, in kibibytes (1024 bytes), of the memory used by this object.
vtkMTimeType GetMTime() override
Return the modification time of this object and of its arrays.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instantiation, type information, and printing.
decltype(auto) Dispatch(Functor &&functor, Args &&... args) const
vtkCellArray::DispatchUtilities DispatchUtilities
vtkIdType GetFaceId(vtkIdType cellId, int face) const
Return the id, in Faces, of the face face of the cell cellId.
void Squeeze()
Reclaim any extra memory while preserving data.
void ShallowCopy(vtkPolyhedronCellArray *other)
Shallow copy the given polyhedron cell array: its Faces and FaceLocations are shared.
void ExportLegacyFormat(vtkIdTypeArray *faces, vtkIdTypeArray *faceLocations)
Fill faces and faceLocations with the legacy layout of the faces of the cells, the two vtkIdTypeArray...
vtkCellArray::AffineArray32 AffineArray32
vtkIdType GetFaceSize(vtkIdType cellId, int face) const
Return the number of points of the face face of the cell cellId.
Hold a reference to a vtkObjectBase instance.
vtkIdType GetFaceId(LocationOffsetsT *locationOffsets, LocationConnectivityT *locationConnectivity, vtkIdType cellId, int face)
static vtkIdType GetEndOffset(OffsetsT *offsets, vtkIdType cellId)
static vtkIdType GetBeginOffset(OffsetsT *offsets, vtkIdType cellId)
static decltype(vtk::DataArrayValueRange< 1, vtkIdType >(std::declval< ArrayT >())) GetRange(ArrayT *array)
int operator()(FaceOffsetsT *, FaceConnectivityT *, LocationOffsetsT *locationOffsets, LocationConnectivityT *, vtkIdType cellId) const
vtkIdType operator()(FaceOffsetsT *, FaceConnectivityT *, LocationOffsetsT *locationOffsets, LocationConnectivityT *locationConnectivity, vtkIdType cellId, int face) const
vtkIdType operator()(FaceOffsetsT *faceOffsets, FaceConnectivityT *faceConnectivity, LocationOffsetsT *locationOffsets, LocationConnectivityT *locationConnectivity, vtkIdType cellId, int face, vtkIdType const *&pts, vtkIdList *tempIds) const
vtkIdType operator()(FaceOffsetsT *faceOffsets, FaceConnectivityT *, LocationOffsetsT *locationOffsets, LocationConnectivityT *locationConnectivity, vtkIdType cellId, int face) const
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
vtkTypeUInt32 vtkMTimeType
#define VTK_SIZEHINT(...)
#define VTK_MARSHALMANUAL