VTK
9.1.0
|
object to represent cell connectivity More...
#include <vtkCellArray.h>
Classes | |
struct | Storage |
struct | VisitState |
Public Types | |
using | ArrayType32 = vtkTypeInt32Array |
using | ArrayType64 = vtkTypeInt64Array |
using | StorageArrayList = vtkTypeList::Create< ArrayType32, ArrayType64 > |
List of possible array types used for storage. | |
using | InputArrayList = typename vtkTypeList::Unique< vtkTypeList::Create< vtkAOSDataArrayTemplate< int >, vtkAOSDataArrayTemplate< long >, vtkAOSDataArrayTemplate< long long > > >::Result |
List of possible ArrayTypes that are compatible with internal storage. | |
Public Member Functions | |
vtkTypeBool | Allocate (vtkIdType sz, vtkIdType vtkNotUsed(ext)=1000) |
Allocate memory. | |
bool | AllocateEstimate (vtkIdType numCells, vtkIdType maxCellSize) |
Pre-allocate memory in internal data structures. | |
bool | AllocateExact (vtkIdType numCells, vtkIdType connectivitySize) |
Pre-allocate memory in internal data structures. | |
bool | AllocateCopy (vtkCellArray *other) |
Pre-allocate memory in internal data structures to match the used size of the input vtkCellArray. | |
bool | ResizeExact (vtkIdType numCells, vtkIdType connectivitySize) |
ResizeExact() resizes the internal structures to hold numCells total cell offsets and connectivitySize total pointIds. | |
void | Initialize () |
Free any memory and reset to an empty state. | |
void | Reset () |
Reuse list. | |
void | Squeeze () |
Reclaim any extra memory while preserving data. | |
bool | IsValid () |
Check that internal storage is consistent and in a valid state. | |
vtkIdType | GetNumberOfCells () const |
Get the number of cells in the array. | |
vtkIdType | GetNumberOfOffsets () const |
Get the number of elements in the offsets array. | |
vtkIdType | GetNumberOfConnectivityIds () const |
Get the size of the connectivity array that stores the point ids. | |
vtkCellArrayIterator * | NewIterator () |
NewIterator returns a new instance of vtkCellArrayIterator that is initialized to point at the first cell's data. | |
bool | SetData (vtkDataArray *offsets, vtkDataArray *connectivity) |
Sets the internal arrays to the supplied offsets and connectivity arrays. | |
bool | SetData (vtkIdType cellSize, vtkDataArray *connectivity) |
Sets the internal arrays to the supported connectivity array with an offsets array automatically generated given the fixed cells size. | |
bool | IsStorage64Bit () const |
bool | IsStorageShareable () const |
vtkIdType | IsHomogeneous () |
Check if all cells have the same number of vertices. | |
void | InitTraversal () |
int | GetNextCell (vtkIdType &npts, vtkIdType const *&pts) |
int | GetNextCell (vtkIdList *pts) |
void | GetCellAtId (vtkIdType cellId, vtkIdType &cellSize, vtkIdType const *&cellPoints) |
Return the point ids for the cell at cellId. | |
void | GetCellAtId (vtkIdType cellId, vtkIdList *pts) |
Return the point ids for the cell at cellId. | |
vtkIdType | GetCellSize (const vtkIdType cellId) const |
Return the size of the cell at cellId. | |
vtkIdType | InsertNextCell (vtkCell *cell) |
Insert a cell object. | |
vtkIdType | InsertNextCell (vtkIdType npts, const vtkIdType *pts) |
Create a cell by specifying the number of points and an array of point id's. | |
vtkIdType | InsertNextCell (vtkIdList *pts) |
Create a cell by specifying a list of point ids. | |
vtkIdType | InsertNextCell (const std::initializer_list< vtkIdType > &cell) |
Overload that allows InsertNextCell({0, 1, 2}) syntax. | |
vtkIdType | InsertNextCell (int npts) |
Create cells by specifying a count of total points to be inserted, and then adding points one at a time using method InsertCellPoint(). | |
void | InsertCellPoint (vtkIdType id) |
Used in conjunction with InsertNextCell(npts) to add another point to the list of cells. | |
void | UpdateCellCount (int npts) |
Used in conjunction with InsertNextCell(int npts) and InsertCellPoint() to update the number of points defining the cell. | |
void | ReverseCellAtId (vtkIdType cellId) |
Reverses the order of the point ids for the specified cell. | |
void | ReplaceCellAtId (vtkIdType cellId, const std::initializer_list< vtkIdType > &cell) |
Overload that allows ReplaceCellAtId(cellId, {0, 1, 2}) syntax. | |
int | GetMaxCellSize () |
Returns the size of the largest cell. | |
void | DeepCopy (vtkCellArray *ca) |
Perform a deep copy (no reference counting) of the given cell array. | |
void | ShallowCopy (vtkCellArray *ca) |
Shallow copy ca into this cell array. | |
void | Append (vtkCellArray *src, vtkIdType pointOffset=0) |
Append cells from src into this. | |
void | ExportLegacyFormat (vtkIdTypeArray *data) |
Fill data with the old-style vtkCellArray data layout, e.g. | |
unsigned long | GetActualMemorySize () const |
Return the memory in kibibytes (1024 bytes) consumed by this cell array. | |
virtual void | SetNumberOfCells (vtkIdType) |
Set the number of cells in the array. | |
vtkIdType | EstimateSize (vtkIdType numCells, int maxPtsPerCell) |
Utility routines help manage memory of cell array. | |
vtkIdType | GetSize () |
Get the size of the allocated connectivity array. | |
vtkIdType | GetNumberOfConnectivityEntries () |
Return the size of the array that would be returned from ExportLegacyFormat(). | |
void | GetCell (vtkIdType loc, vtkIdType &npts, const vtkIdType *&pts) |
Internal method used to retrieve a cell given a legacy offset location. | |
void | GetCell (vtkIdType loc, vtkIdList *pts) |
Internal method used to retrieve a cell given a legacy offset location. | |
vtkIdType | GetInsertLocation (int npts) |
Computes the current legacy insertion location within the internal array. | |
void | ReverseCell (vtkIdType loc) |
Special method inverts ordering of cell at the specified legacy location. | |
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. | |
void | SetCells (vtkIdType ncells, vtkIdTypeArray *cells) |
Define multiple cells by providing a connectivity list. | |
vtkIdTypeArray * | GetData () |
Return the underlying data as a data array. | |
void | SetData (vtkTypeInt32Array *offsets, vtkTypeInt32Array *connectivity) |
Set the internal data arrays to the supplied offsets and connectivity arrays. | |
void | SetData (vtkTypeInt64Array *offsets, vtkTypeInt64Array *connectivity) |
Set the internal data arrays to the supplied offsets and connectivity arrays. | |
void | SetData (vtkIdTypeArray *offsets, vtkIdTypeArray *connectivity) |
Set the internal data arrays to the supplied offsets and connectivity arrays. | |
void | SetData (vtkAOSDataArrayTemplate< int > *offsets, vtkAOSDataArrayTemplate< int > *connectivity) |
Set the internal data arrays to the supplied offsets and connectivity arrays. | |
void | SetData (vtkAOSDataArrayTemplate< long > *offsets, vtkAOSDataArrayTemplate< long > *connectivity) |
Set the internal data arrays to the supplied offsets and connectivity arrays. | |
void | SetData (vtkAOSDataArrayTemplate< long long > *offsets, vtkAOSDataArrayTemplate< long long > *connectivity) |
Set the internal data arrays to the supplied offsets and connectivity arrays. | |
void | Use32BitStorage () |
Initialize internal data structures to use 32- or 64-bit storage. | |
void | Use64BitStorage () |
Initialize internal data structures to use 32- or 64-bit storage. | |
void | UseDefaultStorage () |
Initialize internal data structures to use 32- or 64-bit storage. | |
bool | CanConvertTo32BitStorage () const |
Check if the existing data can safely be converted to use 32- or 64- bit storage. | |
bool | CanConvertTo64BitStorage () const |
Check if the existing data can safely be converted 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. | |
bool | ConvertTo32BitStorage () |
Convert internal data structures to use 32- or 64-bit storage. | |
bool | ConvertTo64BitStorage () |
Convert internal data structures to use 32- or 64-bit storage. | |
bool | ConvertToDefaultStorage () |
Convert internal data structures to use 32- or 64-bit storage. | |
bool | ConvertToSmallestStorage () |
Convert internal data structures to use 32- or 64-bit storage. | |
vtkDataArray * | GetOffsetsArray () |
Return the array used to store cell offsets. | |
ArrayType32 * | GetOffsetsArray32 () |
Return the array used to store cell offsets. | |
ArrayType64 * | GetOffsetsArray64 () |
Return the array used to store cell offsets. | |
vtkDataArray * | GetConnectivityArray () |
Return the array used to store the point ids that define the cells' connectivity. | |
ArrayType32 * | GetConnectivityArray32 () |
Return the array used to store the point ids that define the cells' connectivity. | |
ArrayType64 * | GetConnectivityArray64 () |
Return the array used to store the point ids that define the cells' connectivity. | |
vtkIdType | GetTraversalCellId () |
Get/Set the current cellId for traversal. | |
void | SetTraversalCellId (vtkIdType cellId) |
Get/Set the current cellId for traversal. | |
void | ReplaceCellAtId (vtkIdType cellId, vtkIdList *list) |
Replaces the point ids for the specified cell with the supplied list. | |
void | ReplaceCellAtId (vtkIdType cellId, vtkIdType cellSize, const vtkIdType *cellPoints) |
Replaces the point ids for the specified cell with the supplied list. | |
void | ImportLegacyFormat (vtkIdTypeArray *data) |
Import an array of data with the legacy vtkCellArray layout, e.g.: | |
void | ImportLegacyFormat (const vtkIdType *data, vtkIdType len) |
Import an array of data with the legacy vtkCellArray layout, e.g.: | |
void | AppendLegacyFormat (vtkIdTypeArray *data, vtkIdType ptOffset=0) |
Append an array of data with the legacy vtkCellArray layout, e.g.: | |
void | AppendLegacyFormat (const vtkIdType *data, vtkIdType len, vtkIdType ptOffset=0) |
Append an array of data with the legacy vtkCellArray layout, e.g.: | |
template<typename Functor , typename... Args, typename = typename std::enable_if<ReturnsVoid<Functor, Args...>::value>::type> | |
void | Visit (Functor &&functor, Args &&... args) |
template<typename Functor , typename... Args, typename = typename std::enable_if<ReturnsVoid<Functor, Args...>::value>::type> | |
void | Visit (Functor &&functor, Args &&... args) const |
template<typename Functor , typename... Args, typename = typename std::enable_if<!ReturnsVoid<Functor, Args...>::value>::type> | |
GetReturnType< Functor, Args... > | Visit (Functor &&functor, Args &&... args) |
template<typename Functor , typename... Args, typename = typename std::enable_if<!ReturnsVoid<Functor, Args...>::value>::type> | |
GetReturnType< Functor, Args... > | Visit (Functor &&functor, Args &&... args) const |
vtkIdType | GetTraversalLocation () |
Get/Set the current traversal legacy location. | |
vtkIdType | GetTraversalLocation (vtkIdType npts) |
Get/Set the current traversal legacy location. | |
void | SetTraversalLocation (vtkIdType loc) |
Get/Set the current traversal legacy location. | |
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. | |
virtual vtkMTimeType | GetMTime () |
Return this object's modified time. | |
void | PrintSelf (ostream &os, vtkIndent indent) override |
Methods invoked by print to print information about the object including superclasses. | |
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) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
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. | |
int | InvokeEvent (unsigned long event, void *callData) |
This method invokes an event and return whether the event was aborted or not. | |
int | InvokeEvent (const char *event, void *callData) |
This method invokes an event and return whether the event was aborted or not. | |
Public Member Functions inherited from vtkObjectBase | |
const char * | GetClassName () const |
Return the class name as a string. | |
virtual vtkTypeBool | IsA (const char *name) |
Return 1 if this class is the same type of (or a subclass of) the named class. | |
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. | |
virtual 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. | |
Protected Member Functions | |
vtkCellArray () | |
~vtkCellArray () 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 | RegisterInternal (vtkObjectBase *, vtkTypeBool check) |
virtual void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Protected Attributes | |
Storage | Storage |
vtkNew< vtkIdList > | TempCell |
vtkIdType | TraversalCellId { 0 } |
vtkNew< vtkIdTypeArray > | LegacyData |
Protected Attributes inherited from vtkObject | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
Protected Attributes inherited from vtkObjectBase | |
std::atomic< int32_t > | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
Friends | |
class | vtkCellArrayIterator |
typedef vtkObject | Superclass |
Standard methods for instantiation, type information, and printing. | |
static vtkCellArray * | New () |
Standard methods for instantiation, type information, and printing. | |
static vtkTypeBool | IsTypeOf (const char *type) |
Standard methods for instantiation, type information, and printing. | |
static vtkCellArray * | 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. | |
vtkCellArray * | 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. | |
void | PrintDebug (ostream &os) |
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 (int 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 int | 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 () |
object to represent cell connectivity
vtkCellArray stores dataset topologies as an explicit connectivity table listing the point ids that make up each cell.
Internally, the connectivity table is represented as two arrays: Offsets and Connectivity.
Offsets is an array of [numCells+1] values indicating the index in the Connectivity array where each cell's points start. The last value is always the length of the Connectivity array.
The Connectivity array stores the lists of point ids for each cell.
Thus, for a dataset consisting of 2 triangles, a quad, and a line, the internal arrays will appear as follows:
While this class provides traversal methods (the legacy InitTraversal(), GetNextCell() methods, and the newer method GetCellAtId()) these are in general not thread-safe. Whenever possible it is preferrable to use a local thread-safe, vtkCellArrayIterator object, which can be obtained via:
(Note however that depending on the type and structure of internal storage, a cell array iterator may be significantly slower than direct traversal over the cell array due to extra data copying. Factors of 3-4X are not uncommon. See vtkCellArrayIterator for more information. Also note that an iterator may become invalid if the internal vtkCellArray storage is modified.)
Other methods are also available for allocation and memory-related management; insertion of new cells into the vtkCellArray; and limited editing operations such as replacing one cell with a new cell of the same size.
The internal arrays may store either 32- or 64-bit values, though most of the API will prefer to use vtkIdType to refer to items in these arrays. This enables significant memory savings when vtkIdType is 64-bit, but 32 bits are sufficient to store all of the values in the connectivity table. Using 64-bit storage with a 32-bit vtkIdType is permitted, but values too large to fit in a 32-bit signed integer will be truncated when accessed through the API. (The particular internal storage type has implications on performance depending on vtkIdType. If the internal storage is equivalent to vtkIdType, then methods that return pointers to arrays of point ids can share the internal storage; otherwise a copy of internal memory must be performed.)
Methods for managing the storage type are:
bool IsStorage64Bit()
bool IsStorageShareable() // Can pointers to internal storage be shared
void Use32BitStorage()
void Use64BitStorage()
void UseDefaultStorage() // Depends on vtkIdType
bool CanConvertTo32BitStorage()
bool CanConvertTo64BitStorage()
bool CanConvertToDefaultStorage() // Depends on vtkIdType
bool ConvertTo32BitStorage()
bool ConvertTo64BitStorage()
bool ConvertToDefaultStorage() // Depends on vtkIdType
bool ConvertToSmallestStorage() // Depends on current values in arrays
Note that some legacy methods are still available that reflect the previous storage format of this data, which embedded the cell sizes into the Connectivity array:
The methods require an external lookup table to allow random access, which was historically stored in the vtkCellTypes object. The following methods in vtkCellArray still support this style of indexing for compatibility purposes, but these are slow as they must perform some complex computations to convert the old "location" into the new "offset" and should be avoided. These methods (and their modern equivalents) are:
Some other legacy methods were completely removed, such as GetPointer() / WritePointer(), since they are cannot be effectively emulated under the current design. If external code needs to support both the old and new version of the vtkCellArray API, the VTK_CELL_ARRAY_V2 preprocessor definition may be used to detect which API is being compiled against.
Definition at line 289 of file vtkCellArray.h.
using vtkCellArray::ArrayType32 = vtkTypeInt32Array |
Definition at line 292 of file vtkCellArray.h.
using vtkCellArray::ArrayType64 = vtkTypeInt64Array |
Definition at line 293 of file vtkCellArray.h.
typedef vtkObject vtkCellArray::Superclass |
Standard methods for instantiation, type information, and printing.
Definition at line 301 of file vtkCellArray.h.
using vtkCellArray::StorageArrayList = vtkTypeList::Create<ArrayType32, ArrayType64> |
List of possible array types used for storage.
May be used with vtkArrayDispatch::Dispatch[2]ByArray to process internal arrays. Both the Connectivity and Offset arrays are guaranteed to have the same type.
Definition at line 314 of file vtkCellArray.h.
using vtkCellArray::InputArrayList = typename vtkTypeList::Unique<vtkTypeList::Create<vtkAOSDataArrayTemplate<int>, vtkAOSDataArrayTemplate<long>, vtkAOSDataArrayTemplate<long long> >>::Result |
List of possible ArrayTypes that are compatible with internal storage.
Single component AOS-layout arrays holding one of these types may be passed to the method SetData to setup the cell array state.
This can be used with vtkArrayDispatch::DispatchByArray, etc to check input arrays before assigning them to a cell array.
Definition at line 324 of file vtkCellArray.h.
|
protected |
|
overrideprotected |
|
static |
Standard methods for instantiation, type information, and printing.
|
static |
Standard methods for instantiation, type information, and printing.
|
virtual |
Standard methods for instantiation, type information, and printing.
Reimplemented from vtkObjectBase.
|
static |
Standard methods for instantiation, type information, and printing.
|
protectedvirtual |
Standard methods for instantiation, type information, and printing.
vtkCellArray * vtkCellArray::NewInstance | ( | ) | const |
Standard methods for instantiation, type information, and printing.
|
overridevirtual |
Standard methods for instantiation, type information, and printing.
Reimplemented from vtkObject.
void vtkCellArray::PrintDebug | ( | ostream & | os | ) |
Standard methods for instantiation, type information, and printing.
|
inline |
Allocate memory.
This currently allocates both the offsets and connectivity arrays to sz.
Definition at line 336 of file vtkCellArray.h.
Pre-allocate memory in internal data structures.
Does not change the number of cells, only the array capacities. Existing data is NOT preserved.
numCells | The number of expected cells in the dataset. |
maxCellSize | The number of points per cell to allocate memory for. |
Definition at line 350 of file vtkCellArray.h.
Pre-allocate memory in internal data structures.
Does not change the number of cells, only the array capacities. Existing data is NOT preserved.
numCells | The number of expected cells in the dataset. |
connectivitySize | The total number of pointIds stored for all cells. |
|
inline |
Pre-allocate memory in internal data structures to match the used size of the input vtkCellArray.
Does not change the number of cells, only the array capacities. Existing data is NOT preserved.
other | The vtkCellArray to use as a reference. |
Definition at line 375 of file vtkCellArray.h.
ResizeExact() resizes the internal structures to hold numCells total cell offsets and connectivitySize total pointIds.
Old data is preserved, and newly-available memory is not initialized.
void vtkCellArray::Initialize | ( | ) |
Free any memory and reset to an empty state.
|
inline |
Reuse list.
Reset to initial state without freeing memory.
Definition at line 1702 of file vtkCellArray.h.
void vtkCellArray::Squeeze | ( | ) |
Reclaim any extra memory while preserving data.
bool vtkCellArray::IsValid | ( | ) |
Check that internal storage is consistent and in a valid state.
Specifically, this function returns true if and only if:
|
inline |
Get the number of cells in the array.
Definition at line 423 of file vtkCellArray.h.
|
inline |
Get the number of elements in the offsets array.
This will be the number of cells + 1.
Definition at line 439 of file vtkCellArray.h.
|
inline |
Get the size of the connectivity array that stores the point ids.
Definition at line 457 of file vtkCellArray.h.
vtkCellArrayIterator * vtkCellArray::NewIterator | ( | ) |
NewIterator returns a new instance of vtkCellArrayIterator that is initialized to point at the first cell's data.
The caller is responsible for Delete()'ing the object.
void vtkCellArray::SetData | ( | vtkTypeInt32Array * | offsets, |
vtkTypeInt32Array * | connectivity | ||
) |
Set the internal data arrays to the supplied offsets and connectivity arrays.
Note that the input arrays may be copied and not used directly. To avoid copying, use vtkIdTypeArray, vtkCellArray::ArrayType32, or vtkCellArray::ArrayType64.
void vtkCellArray::SetData | ( | vtkTypeInt64Array * | offsets, |
vtkTypeInt64Array * | connectivity | ||
) |
Set the internal data arrays to the supplied offsets and connectivity arrays.
Note that the input arrays may be copied and not used directly. To avoid copying, use vtkIdTypeArray, vtkCellArray::ArrayType32, or vtkCellArray::ArrayType64.
void vtkCellArray::SetData | ( | vtkIdTypeArray * | offsets, |
vtkIdTypeArray * | connectivity | ||
) |
Set the internal data arrays to the supplied offsets and connectivity arrays.
Note that the input arrays may be copied and not used directly. To avoid copying, use vtkIdTypeArray, vtkCellArray::ArrayType32, or vtkCellArray::ArrayType64.
void vtkCellArray::SetData | ( | vtkAOSDataArrayTemplate< int > * | offsets, |
vtkAOSDataArrayTemplate< int > * | connectivity | ||
) |
Set the internal data arrays to the supplied offsets and connectivity arrays.
Note that the input arrays may be copied and not used directly. To avoid copying, use vtkIdTypeArray, vtkCellArray::ArrayType32, or vtkCellArray::ArrayType64.
void vtkCellArray::SetData | ( | vtkAOSDataArrayTemplate< long > * | offsets, |
vtkAOSDataArrayTemplate< long > * | connectivity | ||
) |
Set the internal data arrays to the supplied offsets and connectivity arrays.
Note that the input arrays may be copied and not used directly. To avoid copying, use vtkIdTypeArray, vtkCellArray::ArrayType32, or vtkCellArray::ArrayType64.
void vtkCellArray::SetData | ( | vtkAOSDataArrayTemplate< long long > * | offsets, |
vtkAOSDataArrayTemplate< long long > * | connectivity | ||
) |
Set the internal data arrays to the supplied offsets and connectivity arrays.
Note that the input arrays may be copied and not used directly. To avoid copying, use vtkIdTypeArray, vtkCellArray::ArrayType32, or vtkCellArray::ArrayType64.
bool vtkCellArray::SetData | ( | vtkDataArray * | offsets, |
vtkDataArray * | connectivity | ||
) |
Sets the internal arrays to the supplied offsets and connectivity arrays.
This is a convenience method, and may fail if the following conditions are not met:
If invalid arrays are passed in, an error is logged and the function will return false.
bool vtkCellArray::SetData | ( | vtkIdType | cellSize, |
vtkDataArray * | connectivity | ||
) |
Sets the internal arrays to the supported connectivity array with an offsets array automatically generated given the fixed cells size.
This is a convenience method, and may fail if the following conditions are not met:
connectivity
array must be one of the types in InputArrayList.connectivity
array size must be a multiple of cellSize
.If invalid arrays are passed in, an error is logged and the function will return false.
|
inline |
Definition at line 530 of file vtkCellArray.h.
|
inline |
Definition at line 538 of file vtkCellArray.h.
void vtkCellArray::Use32BitStorage | ( | ) |
Initialize internal data structures to use 32- or 64-bit storage.
If selecting default storage, the storage depends on the VTK_USE_64BIT_IDS setting.
All existing data is erased.
void vtkCellArray::Use64BitStorage | ( | ) |
Initialize internal data structures to use 32- or 64-bit storage.
If selecting default storage, the storage depends on the VTK_USE_64BIT_IDS setting.
All existing data is erased.
void vtkCellArray::UseDefaultStorage | ( | ) |
Initialize internal data structures to use 32- or 64-bit storage.
If selecting default storage, the storage depends on the VTK_USE_64BIT_IDS setting.
All existing data is erased.
bool vtkCellArray::CanConvertTo32BitStorage | ( | ) | const |
Check if the existing data can safely be converted to use 32- or 64- bit storage.
Ensures that all values can be converted to the target storage without truncating. If selecting default storage, the storage depends on the VTK_USE_64BIT_IDS setting.
bool vtkCellArray::CanConvertTo64BitStorage | ( | ) | const |
Check if the existing data can safely be converted to use 32- or 64- bit storage.
Ensures that all values can be converted to the target storage without truncating. If selecting default storage, the storage depends on the VTK_USE_64BIT_IDS setting.
bool vtkCellArray::CanConvertToDefaultStorage | ( | ) | const |
Check if the existing data can safely be converted to use 32- or 64- bit storage.
Ensures that all values can be converted to the target storage without truncating. If selecting default storage, the storage depends on the VTK_USE_64BIT_IDS setting.
bool vtkCellArray::ConvertTo32BitStorage | ( | ) |
Convert internal data structures to use 32- or 64-bit storage.
If selecting default storage, the storage depends on the VTK_USE_64BIT_IDS setting.
If selecting smallest storage, the data is checked to see what the smallest safe storage for the existing data is, and then converts to it.
Existing data is preserved.
bool vtkCellArray::ConvertTo64BitStorage | ( | ) |
Convert internal data structures to use 32- or 64-bit storage.
If selecting default storage, the storage depends on the VTK_USE_64BIT_IDS setting.
If selecting smallest storage, the data is checked to see what the smallest safe storage for the existing data is, and then converts to it.
Existing data is preserved.
bool vtkCellArray::ConvertToDefaultStorage | ( | ) |
Convert internal data structures to use 32- or 64-bit storage.
If selecting default storage, the storage depends on the VTK_USE_64BIT_IDS setting.
If selecting smallest storage, the data is checked to see what the smallest safe storage for the existing data is, and then converts to it.
Existing data is preserved.
bool vtkCellArray::ConvertToSmallestStorage | ( | ) |
Convert internal data structures to use 32- or 64-bit storage.
If selecting default storage, the storage depends on the VTK_USE_64BIT_IDS setting.
If selecting smallest storage, the data is checked to see what the smallest safe storage for the existing data is, and then converts to it.
Existing data is preserved.
|
inline |
Return the array used to store cell offsets.
The 32/64 variants are only valid when IsStorage64Bit() returns the appropriate value.
Definition at line 603 of file vtkCellArray.h.
|
inline |
Return the array used to store cell offsets.
The 32/64 variants are only valid when IsStorage64Bit() returns the appropriate value.
Definition at line 614 of file vtkCellArray.h.
|
inline |
Return the array used to store cell offsets.
The 32/64 variants are only valid when IsStorage64Bit() returns the appropriate value.
Definition at line 615 of file vtkCellArray.h.
|
inline |
Return the array used to store the point ids that define the cells' connectivity.
The 32/64 variants are only valid when IsStorage64Bit() returns the appropriate value.
Definition at line 624 of file vtkCellArray.h.
|
inline |
Return the array used to store the point ids that define the cells' connectivity.
The 32/64 variants are only valid when IsStorage64Bit() returns the appropriate value.
Definition at line 635 of file vtkCellArray.h.
|
inline |
Return the array used to store the point ids that define the cells' connectivity.
The 32/64 variants are only valid when IsStorage64Bit() returns the appropriate value.
Definition at line 636 of file vtkCellArray.h.
vtkIdType vtkCellArray::IsHomogeneous | ( | ) |
Check if all cells have the same number of vertices.
The return value is coded as:
|
inline |
InitTraversal() initializes the traversal of the list of cells.
Definition at line 1600 of file vtkCellArray.h.
GetNextCell() gets the next cell in the list. If end of list is encountered, 0 is returned. A value of 1 is returned whenever npts and pts have been updated without error.
Do not modify the returned pts pointer, as it may point to shared memory.
Definition at line 1606 of file vtkCellArray.h.
|
inline |
GetNextCell() gets the next cell in the list. If end of list is encountered, 0 is returned.
Definition at line 1621 of file vtkCellArray.h.
|
inline |
Return the point ids for the cell at cellId.
Definition at line 1640 of file vtkCellArray.h.
Return the point ids for the cell at cellId.
This always copies the cell ids (i.e., the list of points pts into the supplied vtkIdList). This method is thread safe.
Definition at line 1647 of file vtkCellArray.h.
Return the size of the cell at cellId.
Definition at line 1634 of file vtkCellArray.h.
Insert a cell object.
Return the cell id of the cell.
Definition at line 1694 of file vtkCellArray.h.
Create a cell by specifying the number of points and an array of point id's.
Return the cell id of the cell.
Definition at line 1653 of file vtkCellArray.h.
Create a cell by specifying a list of point ids.
Return the cell id of the cell.
Definition at line 1687 of file vtkCellArray.h.
Overload that allows InsertNextCell({0, 1, 2})
syntax.
InsertNextCell({3})
) will call the InsertNextCell(int)
overload instead. Definition at line 738 of file vtkCellArray.h.
|
inline |
Create cells by specifying a count of total points to be inserted, and then adding points one at a time using method InsertCellPoint().
If you don't know the count initially, use the method UpdateCellCount() to complete the cell. Return the cell id of the cell.
Definition at line 1660 of file vtkCellArray.h.
|
inline |
Used in conjunction with InsertNextCell(npts) to add another point to the list of cells.
Definition at line 1666 of file vtkCellArray.h.
|
inline |
Used in conjunction with InsertNextCell(int npts) and InsertCellPoint() to update the number of points defining the cell.
Definition at line 1681 of file vtkCellArray.h.
vtkIdType vtkCellArray::GetTraversalCellId | ( | ) |
Get/Set the current cellId for traversal.
void vtkCellArray::SetTraversalCellId | ( | vtkIdType | cellId | ) |
Get/Set the current cellId for traversal.
void vtkCellArray::ReverseCellAtId | ( | vtkIdType | cellId | ) |
Reverses the order of the point ids for the specified cell.
Replaces the point ids for the specified cell with the supplied list.
void vtkCellArray::ReplaceCellAtId | ( | vtkIdType | cellId, |
vtkIdType | cellSize, | ||
const vtkIdType * | cellPoints | ||
) |
Replaces the point ids for the specified cell with the supplied list.
|
inline |
Overload that allows ReplaceCellAtId(cellId, {0, 1, 2})
syntax.
Definition at line 799 of file vtkCellArray.h.
int vtkCellArray::GetMaxCellSize | ( | ) |
Returns the size of the largest cell.
The size is the number of points defining the cell.
void vtkCellArray::DeepCopy | ( | vtkCellArray * | ca | ) |
Perform a deep copy (no reference counting) of the given cell array.
void vtkCellArray::ShallowCopy | ( | vtkCellArray * | ca | ) |
Shallow copy ca into this cell array.
void vtkCellArray::Append | ( | vtkCellArray * | src, |
vtkIdType | pointOffset = 0 |
||
) |
Append cells from src into this.
Point ids are offset by pointOffset.
void vtkCellArray::ExportLegacyFormat | ( | vtkIdTypeArray * | data | ) |
Fill data with the old-style vtkCellArray data layout, e.g.
where n0
is the number of points in cell 0, and pX_Y
is the Y'th point in cell X.
void vtkCellArray::ImportLegacyFormat | ( | vtkIdTypeArray * | data | ) |
Import an array of data with the legacy vtkCellArray layout, e.g.:
where n0
is the number of points in cell 0, and pX_Y
is the Y'th point in cell X.
Import an array of data with the legacy vtkCellArray layout, e.g.:
where n0
is the number of points in cell 0, and pX_Y
is the Y'th point in cell X.
void vtkCellArray::AppendLegacyFormat | ( | vtkIdTypeArray * | data, |
vtkIdType | ptOffset = 0 |
||
) |
Append an array of data with the legacy vtkCellArray layout, e.g.:
where n0
is the number of points in cell 0, and pX_Y
is the Y'th point in cell X.
void vtkCellArray::AppendLegacyFormat | ( | const vtkIdType * | data, |
vtkIdType | len, | ||
vtkIdType | ptOffset = 0 |
||
) |
Append an array of data with the legacy vtkCellArray layout, e.g.:
where n0
is the number of points in cell 0, and pX_Y
is the Y'th point in cell X.
unsigned long vtkCellArray::GetActualMemorySize | ( | ) | const |
Return the memory in kibibytes (1024 bytes) consumed by this cell array.
Used to support streaming and reading/writing data. The value returned is guaranteed to be greater than or equal to the memory required to actually represent the data represented by this object. The information returned is valid only after the pipeline has been updated.
|
inline |
The Visit methods allow efficient bulk modification of the vtkCellArray internal arrays by dispatching a functor with the current storage arrays. The simplest functor is of the form:
where state
is an instance of the vtkCellArray::VisitState<ArrayT> class, instantiated for the current storage type of the cell array. See that class for usage details.
The functor may also:
operator()
operator()
A more advanced functor that does these things is shown below, along with its usage. This functor scans a range of cells and returns the largest cell's id:
Definition at line 1047 of file vtkCellArray.h.
|
inline |
The Visit methods allow efficient bulk modification of the vtkCellArray internal arrays by dispatching a functor with the current storage arrays. The simplest functor is of the form:
where state
is an instance of the vtkCellArray::VisitState<ArrayT> class, instantiated for the current storage type of the cell array. See that class for usage details.
The functor may also:
operator()
operator()
A more advanced functor that does these things is shown below, along with its usage. This functor scans a range of cells and returns the largest cell's id:
Definition at line 1067 of file vtkCellArray.h.
|
inline |
The Visit methods allow efficient bulk modification of the vtkCellArray internal arrays by dispatching a functor with the current storage arrays. The simplest functor is of the form:
where state
is an instance of the vtkCellArray::VisitState<ArrayT> class, instantiated for the current storage type of the cell array. See that class for usage details.
The functor may also:
operator()
operator()
A more advanced functor that does these things is shown below, along with its usage. This functor scans a range of cells and returns the largest cell's id:
Definition at line 1087 of file vtkCellArray.h.
|
inline |
The Visit methods allow efficient bulk modification of the vtkCellArray internal arrays by dispatching a functor with the current storage arrays. The simplest functor is of the form:
where state
is an instance of the vtkCellArray::VisitState<ArrayT> class, instantiated for the current storage type of the cell array. See that class for usage details.
The functor may also:
operator()
operator()
A more advanced functor that does these things is shown below, along with its usage. This functor scans a range of cells and returns the largest cell's id:
Definition at line 1106 of file vtkCellArray.h.
|
virtual |
Set the number of cells in the array.
DO NOT do any kind of allocation, advanced use only.
Utility routines help manage memory of cell array.
EstimateSize() returns a value used to initialize and allocate memory for array based on number of cells and maximum number of points making up cell. If every cell is the same size (in terms of number of points), then the memory estimate is guaranteed exact. (If not exact, use Squeeze() to reclaim any extra memory.)
vtkIdType vtkCellArray::GetSize | ( | ) |
Get the size of the allocated connectivity array.
vtkIdType vtkCellArray::GetNumberOfConnectivityEntries | ( | ) |
Return the size of the array that would be returned from ExportLegacyFormat().
Internal method used to retrieve a cell given a legacy offset location.
Internal method used to retrieve a cell given a legacy offset location.
vtkIdType vtkCellArray::GetInsertLocation | ( | int | npts | ) |
Computes the current legacy insertion location within the internal array.
Used in conjunction with GetCell(int loc,...).
vtkIdType vtkCellArray::GetTraversalLocation | ( | ) |
Get/Set the current traversal legacy location.
Get/Set the current traversal legacy location.
void vtkCellArray::SetTraversalLocation | ( | vtkIdType | loc | ) |
Get/Set the current traversal legacy location.
void vtkCellArray::ReverseCell | ( | vtkIdType | loc | ) |
Special method inverts ordering of cell at the specified legacy location.
Must be called carefully or the cell topology may be corrupted.
Replace the point ids of the cell at the legacy location with a different list of point ids.
Calling this method does not mark the vtkCellArray as modified. This is the responsibility of the caller and may be done after multiple calls to ReplaceCell. This call does not support changing the number of points in the cell – the caller must ensure that the target cell has npts points.
void vtkCellArray::SetCells | ( | vtkIdType | ncells, |
vtkIdTypeArray * | cells | ||
) |
Define multiple cells by providing a connectivity list.
The list is in the form (npts,p0,p1,...p(npts-1), repeated for each cell). Be careful using this method because it discards the old cells, and anything referring these cells becomes invalid (for example, if BuildCells() has been called see vtkPolyData). The traversal location is reset to the beginning of the list; the insertion location is set to the end of the list.
cells
. This function merely calls ImportLegacyFormat.vtkIdTypeArray * vtkCellArray::GetData | ( | ) |
Return the underlying data as a data array.
|
friend |
Definition at line 1264 of file vtkCellArray.h.
|
protected |
Definition at line 1410 of file vtkCellArray.h.
Definition at line 1411 of file vtkCellArray.h.
|
protected |
Definition at line 1412 of file vtkCellArray.h.
|
protected |
Definition at line 1414 of file vtkCellArray.h.