VTK  9.7.20261025
vtkPolyhedronCellArray Class Reference

#include <vtkPolyhedronCellArray.h>

Detailed Description

object to represent the faces of polyhedral cells

vtkPolyhedronCellArray stores the topology of polyhedral cells, e.g., the VTK_POLYHEDRON cells of a vtkUnstructuredGrid, as an explicit table listing the faces that make up each cell, and the point ids that make up each face.

Internally, the table is represented as two vtkCellArray: Faces and FaceLocations.

Faces is a vtkCellArray storing every face as a cell, i.e., the list of its point ids.

FaceLocations is a vtkCellArray storing every polyhedral cell as a cell, i.e., the list of the ids of its faces in Faces. A cell that is not polyhedral, e.g., the hexahedron of a vtkUnstructuredGrid that also has polyhedra, has no face.

Thus, for a set of cells consisting of a tetrahedron given by its faces, a hexahedron, and a pyramid given by its faces, the internal arrays will appear as follows:

Topology:
---------
Cell 0: Polyhedron | faces: {0, 1, 2}, {0, 3, 1}, {1, 3, 2}, {2, 3, 0}
Cell 1: Hexahedron | no face
Cell 2: Polyhedron | faces: {4, 7, 6, 5}, {4, 5, 8}, {5, 6, 8}, {6, 7, 8}, {7, 4, 8}
-----------------------
Faces:
Offsets: {0, 3, 6, 9, 12, 16, 19, 22, 25, 28}
Connectivity: {0, 1, 2, 0, 3, 1, 1, 3, 2, 2, 3, 0,
4, 7, 6, 5, 4, 5, 8, 5, 6, 8, 6, 7, 8, 7, 4, 8}
FaceLocations:
Offsets: {0, 4, 4, 9}
Connectivity: {0, 1, 2, 3, 4, 5, 6, 7, 8}

The faces of a cell may also be given by a face stream, as the polyhedra of vtkUnstructuredGrid::InsertNextCell(): the number of points of every face, followed by its point ids, e.g., {3, 0, 1, 2, 3, 0, 3, 1, 3, 1, 3, 2, 3, 2, 3, 0} for the four faces of cell 0 above.

The query methods, e.g., GetCellNumberOfFaces(), GetFaceSize() and GetFacePoints(), dispatch the storage type of the arrays for every call, as vtkCellArray::GetCellAtId(). They are thread-safe if the arrays are not modified, and if every thread gives its own vtkIdList to GetFacePoints(). Whenever many faces are traversed, e.g., in a threaded loop, it is preferable to dispatch the arrays once with Dispatch(), and to read them directly:

struct CountFacePoints : public vtkPolyhedronCellArray::DispatchUtilities
{
template <class FaceOffsetsT, class FaceConnectivityT, class LocationOffsetsT,
class LocationConnectivityT>
vtkIdType operator()(FaceOffsetsT* faceOffsets, FaceConnectivityT*,
LocationOffsetsT* locationOffsets, LocationConnectivityT* locationConnectivity,
vtkIdType cellId)
{
vtkIdType numPoints = 0;
const vtkIdType numFaces = GetCellSize(locationOffsets, cellId);
const auto faceIds = GetCellRange(locationOffsets, locationConnectivity, cellId);
for (int face = 0; face < numFaces; ++face)
{
numPoints += GetCellSize(faceOffsets, faceIds[face]);
}
return numPoints;
}
};
vtkIdType numPoints = polyhedra->Dispatch(CountFacePoints{}, cellId);
vtkCellArray::DispatchUtilities DispatchUtilities
static vtkIdType GetCellSize(OffsetsT *offsets, vtkIdType cellId)
static decltype(vtk::DataArrayValueRange< 1, vtkIdType >(std::declval< ConnectivityT >())) GetCellRange(OffsetsT *offsets, ConnectivityT *conn, vtkIdType cellId)
int vtkIdType
Definition vtkType.h:363

The internal arrays of Faces and FaceLocations may store either 32- or 64-bit values, and may be "fixed size", see vtkCellArray, e.g., the faces of hexahedra converted to polyhedra have 4 points, and their cells 6 faces. The storage type of a vtkPolyhedronCellArray is the storage type of Faces and FaceLocations when they have the same one, otherwise Generic. Methods for managing the storage type are:

See also
vtkCellArray vtkUnstructuredGrid vtkPolyhedron
Tests:
vtkPolyhedronCellArray (Tests)

Definition at line 116 of file vtkPolyhedronCellArray.h.

Inheritance diagram for vtkPolyhedronCellArray:
[legend]
Collaboration diagram for vtkPolyhedronCellArray:
[legend]

Public Types

using AOSArray32 = vtkCellArray::AOSArray32
using AOSArray64 = vtkCellArray::AOSArray64
using AffineArray32 = vtkCellArray::AffineArray32
using AffineArray64 = vtkCellArray::AffineArray64
using StorageTypes = vtkCellArray::StorageTypes
using DispatchUtilities = vtkCellArray::DispatchUtilities

Public Member Functions

bool AllocateEstimate (vtkIdType numCells, vtkIdType maxFacesPerCell, vtkIdType maxFacePoints)
 Pre-allocate memory to store numCells cells of at most maxFacesPerCell faces of at most maxFacePoints points, as vtkCellArray::AllocateEstimate(): existing data is NOT preserved.
void Initialize ()
 Free any memory and reset to an empty state.
void Reset ()
 Reuse the list without freeing memory.
void Squeeze ()
 Reclaim any extra memory while preserving data.
unsigned long GetActualMemorySize () const
 Return the size, in kibibytes (1024 bytes), of the memory used by this object.
void DeepCopy (vtkPolyhedronCellArray *other)
 Perform a deep copy (no reference counting) of the given polyhedron cell array.
void ShallowCopy (vtkPolyhedronCellArray *other)
 Shallow copy the given polyhedron cell array: its Faces and FaceLocations are shared.
void SetData (vtkCellArray *faces, vtkCellArray *faceLocations)
 Set the internal data arrays to the supplied faces and face locations, which are referenced, not copied.
vtkMTimeType GetMTime () override
 Return the modification time of this object and of its arrays.
int GetMaxCellNumberOfFaces () const
 Return the number of faces of the cell with the most faces.
int GetMaxFaceSize () const
 Return the size of the largest face, i.e., its number of points.
StorageTypes GetStorageType () const noexcept
 Return the storage type of the arrays: the one of Faces and FaceLocations if they have the same, otherwise Generic, see Dispatch().
bool IsStorageShareable () const
 Return true if the points of the faces are stored as vtkIdType, so that GetFacePoints() returns a pointer to them instead of copying them.
int GetCellNumberOfFaces (vtkIdType cellId) const
 Return the number of faces of the cell cellId.
vtkIdType GetFaceId (vtkIdType cellId, int face) const
 Return the id, in Faces, of the face face of the cell cellId.
vtkIdType GetFaceSize (vtkIdType cellId, int face) const
 Return the number of points of the face face of the cell cellId.
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 several faces is counted several times.
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(): pts points to the internal storage if it is shareable, see IsStorageShareable(), otherwise the point ids are copied into tempIds, which must be given.
void GetFacePoints (vtkIdType cellId, int face, vtkIdList *pts) const
 Copy the point ids of the face face of the cell cellId into pts.
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: (numFaces, numFace0Pts, id1, id2, ..., numFace1Pts, id1, id2, ...).
void GetCellFaces (vtkIdType cellId, vtkCellArray *faces) const
 Copy the faces of the cell cellId into faces, one cell per face.
VTK_WRAPEXCLUDE vtkIdType InsertNextCell (vtkIdType numFaces, const vtkIdType *faceStream)
 Insert a cell given by its numFaces faces, as a face stream: (numFace0Pts, id1, id2, ..., numFace1Pts, id1, id2, ...).
vtkIdType InsertNextCell (vtkCellArray *faces)
 Insert a cell given by its faces, one cell of faces per face.
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 offset by pointOffset, and the ids of its faces by the number of faces of this.
void ExportLegacyFormat (vtkIdTypeArray *faces, vtkIdTypeArray *faceLocations)
 Fill faces and faceLocations with the legacy layout of the faces of the cells, the two vtkIdTypeArray of vtkUnstructuredGrid before VTK 9.4: faces concatenates the face streams of the cells with faces, e.g.
template<typename Functor, typename... Args>
decltype(auto) Dispatch (Functor &&functor, Args &&... args) const
template<typename Functor, typename... Args>
decltype(auto) Dispatch (Functor &&functor, StorageTypes storageType, Args &&... args) const
vtkCellArray * GetFaces () const
 Return the vtkCellArray of the faces, whose cells are the point ids of the faces, and the vtkCellArray of the face locations, whose cells are the ids of the faces of the polyhedral cells.
vtkCellArray * GetFaceLocations () const
 Return the vtkCellArray of the faces, whose cells are the point ids of the faces, and the vtkCellArray of the face locations, whose cells are the ids of the faces of the polyhedral cells.
vtkIdType GetNumberOfCells () const
 Get the number of cells, and the number of faces of all the cells.
vtkIdType GetNumberOfFaces () const
 Get the number of cells, and the number of faces of all the cells.
bool ConvertTo64BitStorage ()
 Convert the storage of Faces and FaceLocations, see vtkCellArray.
bool ConvertTo32BitStorage ()
 Convert the storage of Faces and FaceLocations, see vtkCellArray.
bool ConvertToDefaultStorage ()
 Convert the storage of Faces and FaceLocations, see vtkCellArray.
bool ConvertToSmallestStorage ()
 Convert the storage of Faces and FaceLocations, see vtkCellArray.
bool ImportLegacyFormat (vtkIdTypeArray *faces, vtkIdTypeArray *faceLocations)
 Import arrays of data with the legacy layout of the faces of the cells, see ExportLegacyFormat(): faces of facesLength values, and faceLocations of one value per cell, numberOfCells values.
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(): faces of facesLength values, and faceLocations of one value per cell, numberOfCells values.
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 ImportLegacyFormat().
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 ImportLegacyFormat().
Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
virtual void DebugOn ()
 Turn debugging output on.
virtual void DebugOff ()
 Turn debugging output off.
bool GetDebug ()
 Get the value of the debug flag.
void SetDebug (bool debugFlag)
 Set the value of the debug flag.
virtual void Modified ()
 Update the modification time for this object.
void RemoveObserver (unsigned long tag)
void RemoveObservers (unsigned long event)
void RemoveObservers (const char *event)
void RemoveAllObservers ()
vtkTypeBool HasObserver (unsigned long event)
vtkTypeBool HasObserver (const char *event)
vtkTypeBool InvokeEvent (unsigned long event)
vtkTypeBool InvokeEvent (const char *event)
std::string GetObjectDescription () const override
 The object description printed in messages and PrintSelf output.
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
vtkCommand * GetCommand (unsigned long tag)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
void RemoveObserver (vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
void RemoveObservers (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
void RemoveObservers (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
vtkTypeBool HasObserver (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
vtkTypeBool HasObserver (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
template<class U, class T>
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events.
template<class U, class T>
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events.
template<class U, class T>
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Allow user to set the AbortFlagOn() with the return value of the callback method.
vtkTypeBool InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not.
vtkTypeBool InvokeEvent (const char *event, void *callData)
 This method invokes an event and return whether the event was aborted or not.
virtual void SetObjectName (const std::string &objectName)
 Set/get the name of this object for reporting purposes.
virtual std::string GetObjectName () const
 Set/get the name of this object for reporting purposes.
Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string.
virtual vtkIdType GetNumberOfGenerationsFromBase (const char *name)
 Given the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class).
virtual void Delete ()
 Delete a VTK object.
virtual void FastDelete ()
 Delete a reference to this object.
void InitializeObjectBase ()
void Print (ostream &os)
 Print an object to an ostream.
void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object).
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object).
int GetReferenceCount ()
 Return the current reference count of this object.
void SetReferenceCount (int)
 Sets the reference count.
bool GetIsInMemkind () const
 A local state flag that remembers whether this object lives in the normal or extended memory space.
virtual void PrintHeader (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses.
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses.
virtual bool UsesGarbageCollector () const
 Indicate whether the class uses vtkGarbageCollector or not.

Protected Member Functions

 vtkPolyhedronCellArray ()
 ~vtkPolyhedronCellArray () override
Protected Member Functions inherited from vtkObject
 vtkObject ()
 ~vtkObject () override
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) override
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr)
 These methods allow a command to exclusively grab all events.
void InternalReleaseFocus ()
 These methods allow a command to exclusively grab all events.
Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
virtual ~vtkObjectBase ()
virtual void ReportReferences (vtkGarbageCollector *)
 vtkObjectBase (const vtkObjectBase &)
void operator= (const vtkObjectBase &)
typedef vtkObject Superclass
 Standard methods for instantiation, type information, and printing.
static vtkPolyhedronCellArray * New ()
 Standard methods for instantiation, type information, and printing.
static vtkTypeBool IsTypeOf (const char *type)
 Standard methods for instantiation, type information, and printing.
static vtkPolyhedronCellArray * SafeDownCast (vtkObjectBase *o)
 Standard methods for instantiation, type information, and printing.
virtual vtkTypeBool IsA (const char *type)
 Standard methods for instantiation, type information, and printing.
vtkPolyhedronCellArray * NewInstance () const
 Standard methods for instantiation, type information, and printing.
void PrintSelf (ostream &os, vtkIndent indent) override
 Standard methods for instantiation, type information, and printing.
virtual vtkObjectBase * NewInstanceInternal () const
 Standard methods for instantiation, type information, and printing.

Additional Inherited Members

Static Public Member Functions inherited from vtkObject
static vtkObject * New ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
static void BreakOnError ()
 This method is called when vtkErrorMacro executes.
static void SetGlobalWarningDisplay (vtkTypeBool val)
 This is a global flag that controls whether any debug, warning or error messages are displayed.
static void GlobalWarningDisplayOn ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
static void GlobalWarningDisplayOff ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
static vtkTypeBool GetGlobalWarningDisplay ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 Return 1 if this class type is the same type of (or a subclass of) the named class.
static vtkIdType GetNumberOfGenerationsFromBaseType (const char *name)
 Given a the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class).
static vtkObjectBase * New ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
static void SetMemkindDirectory (const char *directoryname)
 The name of a directory, ideally mounted -o dax, to memory map an extended memory space within.
static bool GetUsingMemkind ()
 A global state flag that controls whether vtkObjects are constructed in the usual way (the default) or within the extended memory space.
Static Protected Member Functions inherited from vtkObjectBase
static vtkMallocingFunction GetCurrentMallocFunction ()
static vtkReallocingFunction GetCurrentReallocFunction ()
static vtkFreeingFunction GetCurrentFreeFunction ()
static vtkFreeingFunction GetAlternateFreeFunction ()
Protected Attributes inherited from vtkObject
bool Debug
vtkTimeStamp MTime
vtkSubjectHelper * SubjectHelper
std::string ObjectName
Protected Attributes inherited from vtkObjectBase
std::atomic< int32_t > ReferenceCount
vtkWeakPointerBase ** WeakPointers

Member Typedef Documentation

◆ AOSArray32

◆ AOSArray64

◆ AffineArray32

◆ AffineArray64

◆ StorageTypes

◆ DispatchUtilities

◆ Superclass

Standard methods for instantiation, type information, and printing.

Definition at line 131 of file vtkPolyhedronCellArray.h.

Constructor & Destructor Documentation

◆ vtkPolyhedronCellArray()

vtkPolyhedronCellArray::vtkPolyhedronCellArray ( )
protected

◆ ~vtkPolyhedronCellArray()

vtkPolyhedronCellArray::~vtkPolyhedronCellArray ( )
overrideprotected

Member Function Documentation

◆ New()

vtkPolyhedronCellArray * vtkPolyhedronCellArray::New ( )
static

Standard methods for instantiation, type information, and printing.

◆ IsTypeOf()

vtkTypeBool vtkPolyhedronCellArray::IsTypeOf ( const char * type)
static

Standard methods for instantiation, type information, and printing.

◆ IsA()

virtual vtkTypeBool vtkPolyhedronCellArray::IsA ( const char * type)
virtual

Standard methods for instantiation, type information, and printing.

Reimplemented from vtkObjectBase.

◆ SafeDownCast()

vtkPolyhedronCellArray * vtkPolyhedronCellArray::SafeDownCast ( vtkObjectBase * o)
static

Standard methods for instantiation, type information, and printing.

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkPolyhedronCellArray::NewInstanceInternal ( ) const
protectedvirtual

Standard methods for instantiation, type information, and printing.

◆ NewInstance()

vtkPolyhedronCellArray * vtkPolyhedronCellArray::NewInstance ( ) const

Standard methods for instantiation, type information, and printing.

◆ PrintSelf()

void vtkPolyhedronCellArray::PrintSelf ( ostream & os,
vtkIndent indent )
overridevirtual

Standard methods for instantiation, type information, and printing.

Reimplemented from vtkObject.

◆ AllocateEstimate()

bool vtkPolyhedronCellArray::AllocateEstimate ( vtkIdType numCells,
vtkIdType maxFacesPerCell,
vtkIdType maxFacePoints )

Pre-allocate memory to store numCells cells of at most maxFacesPerCell faces of at most maxFacePoints points, as vtkCellArray::AllocateEstimate(): existing data is NOT preserved.

Returns true if allocation succeeds.

◆ Initialize()

void vtkPolyhedronCellArray::Initialize ( )

Free any memory and reset to an empty state.

◆ Reset()

void vtkPolyhedronCellArray::Reset ( )

Reuse the list without freeing memory.

◆ Squeeze()

void vtkPolyhedronCellArray::Squeeze ( )

Reclaim any extra memory while preserving data.

◆ GetActualMemorySize()

unsigned long vtkPolyhedronCellArray::GetActualMemorySize ( ) const

Return the size, in kibibytes (1024 bytes), of the memory used by this object.

◆ DeepCopy()

void vtkPolyhedronCellArray::DeepCopy ( vtkPolyhedronCellArray * other)

Perform a deep copy (no reference counting) of the given polyhedron cell array.

◆ ShallowCopy()

void vtkPolyhedronCellArray::ShallowCopy ( vtkPolyhedronCellArray * other)

Shallow copy the given polyhedron cell array: its Faces and FaceLocations are shared.

◆ SetData()

void vtkPolyhedronCellArray::SetData ( vtkCellArray * faces,
vtkCellArray * faceLocations )

Set the internal data arrays to the supplied faces and face locations, which are referenced, not copied.

Both must be non-null.

◆ GetFaces()

vtkCellArray * vtkPolyhedronCellArray::GetFaces ( ) const
inline

Return the vtkCellArray of the faces, whose cells are the point ids of the faces, and the vtkCellArray of the face locations, whose cells are the ids of the faces of the polyhedral cells.

Definition at line 187 of file vtkPolyhedronCellArray.h.

◆ GetFaceLocations()

vtkCellArray * vtkPolyhedronCellArray::GetFaceLocations ( ) const
inline

Return the vtkCellArray of the faces, whose cells are the point ids of the faces, and the vtkCellArray of the face locations, whose cells are the ids of the faces of the polyhedral cells.

Definition at line 188 of file vtkPolyhedronCellArray.h.

◆ GetMTime()

vtkMTimeType vtkPolyhedronCellArray::GetMTime ( )
overridevirtual

Return the modification time of this object and of its arrays.

Reimplemented from vtkObject.

◆ GetNumberOfCells()

vtkIdType vtkPolyhedronCellArray::GetNumberOfCells ( ) const
inline

Get the number of cells, and the number of faces of all the cells.

Definition at line 200 of file vtkPolyhedronCellArray.h.

◆ GetNumberOfFaces()

vtkIdType vtkPolyhedronCellArray::GetNumberOfFaces ( ) const
inline

Get the number of cells, and the number of faces of all the cells.

Definition at line 201 of file vtkPolyhedronCellArray.h.

◆ GetMaxCellNumberOfFaces()

int vtkPolyhedronCellArray::GetMaxCellNumberOfFaces ( ) const
inline

Return the number of faces of the cell with the most faces.

Definition at line 207 of file vtkPolyhedronCellArray.h.

◆ GetMaxFaceSize()

int vtkPolyhedronCellArray::GetMaxFaceSize ( ) const
inline

Return the size of the largest face, i.e., its number of points.

Definition at line 212 of file vtkPolyhedronCellArray.h.

◆ GetStorageType()

StorageTypes vtkPolyhedronCellArray::GetStorageType ( ) const
inlinenoexcept

Return the storage type of the arrays: the one of Faces and FaceLocations if they have the same, otherwise Generic, see Dispatch().

Definition at line 218 of file vtkPolyhedronCellArray.h.

◆ IsStorageShareable()

bool vtkPolyhedronCellArray::IsStorageShareable ( ) const
inline

Return true if the points of the faces are stored as vtkIdType, so that GetFacePoints() returns a pointer to them instead of copying them.

Definition at line 229 of file vtkPolyhedronCellArray.h.

◆ ConvertTo64BitStorage()

bool vtkPolyhedronCellArray::ConvertTo64BitStorage ( )

Convert the storage of Faces and FaceLocations, see vtkCellArray.

Returns true if both are converted. ConvertToSmallestStorage() gives both the same storage type: fixed size only if both can be, and 64-bit if either must be.

◆ ConvertTo32BitStorage()

bool vtkPolyhedronCellArray::ConvertTo32BitStorage ( )

Convert the storage of Faces and FaceLocations, see vtkCellArray.

Returns true if both are converted. ConvertToSmallestStorage() gives both the same storage type: fixed size only if both can be, and 64-bit if either must be.

◆ ConvertToDefaultStorage()

bool vtkPolyhedronCellArray::ConvertToDefaultStorage ( )

Convert the storage of Faces and FaceLocations, see vtkCellArray.

Returns true if both are converted. ConvertToSmallestStorage() gives both the same storage type: fixed size only if both can be, and 64-bit if either must be.

◆ ConvertToSmallestStorage()

bool vtkPolyhedronCellArray::ConvertToSmallestStorage ( )

Convert the storage of Faces and FaceLocations, see vtkCellArray.

Returns true if both are converted. ConvertToSmallestStorage() gives both the same storage type: fixed size only if both can be, and 64-bit if either must be.

◆ GetCellNumberOfFaces()

int vtkPolyhedronCellArray::GetCellNumberOfFaces ( vtkIdType cellId) const
inline

Return the number of faces of the cell cellId.

Definition at line 559 of file vtkPolyhedronCellArray.h.

◆ GetFaceId()

vtkIdType vtkPolyhedronCellArray::GetFaceId ( vtkIdType cellId,
int face ) const
inline

Return the id, in Faces, of the face face of the cell cellId.

Definition at line 565 of file vtkPolyhedronCellArray.h.

◆ GetFaceSize()

vtkIdType vtkPolyhedronCellArray::GetFaceSize ( vtkIdType cellId,
int face ) const
inline

Return the number of points of the face face of the cell cellId.

Definition at line 571 of file vtkPolyhedronCellArray.h.

◆ GetCellNumberOfFacePoints()

vtkIdType vtkPolyhedronCellArray::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 several faces is counted several times.

◆ GetFacePoints() [1/2]

void vtkPolyhedronCellArray::GetFacePoints ( vtkIdType cellId,
int face,
vtkIdType & npts,
vtkIdType const *& pts,
vtkIdList * tempIds ) const
inline

Return the npts point ids pts of the face face of the cell cellId, as vtkCellArray::GetCellAtId(): pts points to the internal storage if it is shareable, see IsStorageShareable(), otherwise the point ids are copied into tempIds, which must be given.

pts is only valid until the faces, or tempIds, are modified.

Definition at line 577 of file vtkPolyhedronCellArray.h.

◆ GetFacePoints() [2/2]

void vtkPolyhedronCellArray::GetFacePoints ( vtkIdType cellId,
int face,
vtkIdList * pts ) const

Copy the point ids of the face face of the cell cellId into pts.

◆ GetFaceStream()

void vtkPolyhedronCellArray::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: (numFaces, numFace0Pts, id1, id2, ..., numFace1Pts, id1, id2, ...).

It is empty if the cell has no face.

◆ GetCellFaces()

void vtkPolyhedronCellArray::GetCellFaces ( vtkIdType cellId,
vtkCellArray * faces ) const

Copy the faces of the cell cellId into faces, one cell per face.

◆ InsertNextCell() [1/2]

VTK_WRAPEXCLUDE vtkIdType vtkPolyhedronCellArray::InsertNextCell ( vtkIdType numFaces,
const vtkIdType * faceStream )

Insert a cell given by its numFaces faces, as a face stream: (numFace0Pts, id1, id2, ..., numFace1Pts, id1, id2, ...).

Returns the id of the cell.

◆ InsertNextCell() [2/2]

vtkIdType vtkPolyhedronCellArray::InsertNextCell ( vtkCellArray * faces)

Insert a cell given by its faces, one cell of faces per face.

Returns the id of the cell.

◆ InsertEmptyCells()

vtkIdType vtkPolyhedronCellArray::InsertEmptyCells ( vtkIdType numCells)

Insert numCells cells without face, e.g., the cells of a vtkUnstructuredGrid that are not polyhedral.

Returns the id of the last one, or -1 if numCells is 0.

◆ Append()

void vtkPolyhedronCellArray::Append ( vtkPolyhedronCellArray * source,
vtkIdType pointOffset = 0 )

Append the cells of source into this, as vtkCellArray::Append(): the point ids of its faces are offset by pointOffset, and the ids of its faces by the number of faces of this.

◆ ExportLegacyFormat()

void vtkPolyhedronCellArray::ExportLegacyFormat ( vtkIdTypeArray * faces,
vtkIdTypeArray * faceLocations )

Fill faces and faceLocations with the legacy layout of the faces of the cells, the two vtkIdTypeArray of vtkUnstructuredGrid before VTK 9.4: faces concatenates the face streams of the cells with faces, e.g.

{ f0, n0_0, p0_0_0, ..., n0_1, p0_1_0, ..., f2, n2_0, p2_0_0, ... }

where f0 is the number of faces of cell 0, n0_Y the number of points of its face Y, and p0_Y_Z the Z'th point of face Y, and faceLocations has one value per cell, the index in faces of its face stream, or -1 for a cell without face. For the cells of the class documentation, the face stream of cell 0 has 17 values, and faceLocations is { 0, -1, 17 }.

◆ ImportLegacyFormat() [1/2]

bool vtkPolyhedronCellArray::ImportLegacyFormat ( vtkIdTypeArray * faces,
vtkIdTypeArray * faceLocations )

Import arrays of data with the legacy layout of the faces of the cells, see ExportLegacyFormat(): faces of facesLength values, and faceLocations of one value per cell, numberOfCells values.

Returns false if the data is corrupt (for example a face location or f0 being too large for the actual buffer), in which case this is left unchanged. Returns true upon successful conversion.

◆ ImportLegacyFormat() [2/2]

bool vtkPolyhedronCellArray::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(): faces of facesLength values, and faceLocations of one value per cell, numberOfCells values.

Returns false if the data is corrupt (for example a face location or f0 being too large for the actual buffer), in which case this is left unchanged. Returns true upon successful conversion.

◆ AppendLegacyFormat() [1/2]

bool vtkPolyhedronCellArray::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 ImportLegacyFormat().

Point ids are offset by ptOffset.

Returns false if the data is corrupt (for example a face location or f0 being too large for the actual buffer), in which case this is left unchanged. Returns true upon successful conversion.

◆ AppendLegacyFormat() [2/2]

bool vtkPolyhedronCellArray::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 ImportLegacyFormat().

Point ids are offset by ptOffset.

Returns false if the data is corrupt (for example a face location or f0 being too large for the actual buffer), in which case this is left unchanged. Returns true upon successful conversion.

◆ Dispatch() [1/2]

template<typename Functor, typename... Args>
decltype(auto) vtkPolyhedronCellArray::Dispatch ( Functor && functor,
Args &&... args ) const
inline
Warning
Advanced use only.

The Dispatch method allows efficient traversal of the vtkPolyhedronCellArray internal arrays by dispatching a functor with the actual arrays, as vtkCellArray::Dispatch(): the offsets and the connectivity of Faces, then of FaceLocations, as vtkCellArray::AOSArray32, vtkCellArray::AOSArray64, the vtkCellArray::AffineArray32 and vtkCellArray::AffineArray64 offsets of fixed size storage, or vtkDataArray for Generic storage, see GetStorageType(). The functor may also return a value, and receive additional arguments:

{
template <class FaceOffsetsT, class FaceConnectivityT, class LocationOffsetsT,
class LocationConnectivityT>
vtkIdType operator()(FaceOffsetsT* faceOffsets, FaceConnectivityT* faceConnectivity,
LocationOffsetsT* locationOffsets, LocationConnectivityT* locationConnectivity,
vtkIdType cellId)
{
// Do work with the arrays
}
};
vtkIdType result = polyhedra->Dispatch(Worker{}, cellId);

The returned type is deduced, so every storage type instantiation of the functor must return the same type.

The second overload takes the storage type, which must be the one of GetStorageType(), so that a caller that dispatches many times, e.g., once per cell, gets it only once. Thus, the first additional argument of the first overload can not be a StorageTypes.

const vtkPolyhedronCellArray::StorageTypes storageType = polyhedra->GetStorageType();
for (vtkIdType cellId = 0; cellId < numCells; ++cellId)
{
vtkIdType result = polyhedra->Dispatch(Worker{}, storageType, cellId);
}
vtkCellArray::StorageTypes StorageTypes

Definition at line 419 of file vtkPolyhedronCellArray.h.

◆ Dispatch() [2/2]

template<typename Functor, typename... Args>
decltype(auto) vtkPolyhedronCellArray::Dispatch ( Functor && functor,
StorageTypes storageType,
Args &&... args ) const
inline

Definition at line 425 of file vtkPolyhedronCellArray.h.


The documentation for this class was generated from the following file: