VTK  9.3.20241003
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
vtkFieldData Class Reference

represent and manipulate fields of data More...

#include <vtkFieldData.h>

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

Classes

class  BasicIterator
 
struct  CopyFieldFlag
 
class  Iterator
 

Public Types

typedef vtkObject Superclass
 

Public Member Functions

virtual vtkTypeBool IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class.
 
vtkFieldDataNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses.
 
virtual void Initialize ()
 Release all data but do not delete object.
 
vtkTypeBool Allocate (vtkIdType sz, vtkIdType ext=1000)
 Allocate data for each array.
 
void CopyStructure (vtkFieldData *)
 Copy data array structure from a given field.
 
void AllocateArrays (int num)
 AllocateArrays actually sets the number of vtkAbstractArray pointers in the vtkFieldData object, not the number of used pointers (arrays).
 
int GetNumberOfArrays ()
 Get the number of arrays of data available.
 
int AddArray (vtkAbstractArray *array)
 Add an array to the array list.
 
void NullData (vtkIdType id)
 Sets every vtkDataArray at index id to a null tuple.
 
vtkDataArrayGetArray (int i)
 Not recommended for use.
 
vtkDataArrayGetArray (const char *arrayName, int &index)
 Not recommended for use.
 
vtkAbstractArrayGetAbstractArray (int i)
 Returns the ith array in the field.
 
vtkAbstractArrayGetAbstractArray (const char *arrayName, int &index)
 Return the array with the name given.
 
virtual void PassData (vtkFieldData *fd)
 Pass entire arrays of input data through to output.
 
void CopyFieldOn (const char *name)
 Turn on/off the copying of the field specified by name.
 
void CopyFieldOff (const char *name)
 
virtual void CopyAllOn (int unused=0)
 Turn on copying of all data.
 
virtual void CopyAllOff (int unused=0)
 Turn off copying of all data.
 
virtual void DeepCopy (vtkFieldData *da)
 Copy a field by creating new data arrays (i.e., duplicate storage).
 
virtual void ShallowCopy (vtkFieldData *da)
 Copy a field by reference counting the data arrays.
 
void Squeeze ()
 Squeezes each data array in the field (Squeeze() reclaims unused memory.)
 
void Reset ()
 Resets each data array in the field (Reset() does not release memory but it makes the arrays look like they are empty.)
 
virtual unsigned long GetActualMemorySize ()
 Return the memory in kibibytes (1024 bytes) consumed by this field data.
 
vtkMTimeType GetMTime () override
 Check object's components for modified times.
 
void GetField (vtkIdList *ptId, vtkFieldData *f)
 Get a field from a list of ids.
 
int GetArrayContainingComponent (int i, int &arrayComp)
 Return the array containing the ith component of the field.
 
int GetNumberOfComponents ()
 Get the number of components in the field.
 
vtkIdType GetNumberOfTuples ()
 Get the number of tuples in the field.
 
void SetNumberOfTuples (vtkIdType number)
 Set the number of tuples for each data array in the field.
 
void SetTuple (vtkIdType i, vtkIdType j, vtkFieldData *source)
 Set the jth tuple in source field data at the ith location.
 
void InsertTuple (vtkIdType i, vtkIdType j, vtkFieldData *source)
 Insert the jth tuple in source field data at the ith location.
 
vtkIdType InsertNextTuple (vtkIdType j, vtkFieldData *source)
 Insert the jth tuple in source field data at the end of the tuple matrix.
 
bool HasAnyGhostBitSet (int bitFlag)
 Helper function that tests if any of the values in ghost array has been set.
 
virtual vtkUnsignedCharArrayGetGhostArray ()
 Get the ghost array, if present in this field data.
 
virtual void RemoveArray (const char *name)
 Remove an array (with the given name) from the list of arrays.
 
virtual void RemoveArray (int index)
 Remove an array (with the given index) from the list of arrays.
 
vtkDataArrayGetArray (const char *arrayName)
 Not recommended for use.
 
vtkAbstractArrayGetAbstractArray (const char *arrayName)
 Return the array with the name given.
 
vtkTypeBool HasArray (const char *name)
 Return 1 if an array with the given name could be found.
 
const char * GetArrayName (int i)
 Get the name of ith array.
 
bool GetRange (const char *name, double range[2], int comp=0)
 Computes the range of the input data array (specified through its name or the index in this field data).
 
bool GetRange (int index, double range[2], int comp=0)
 Computes the range of the input data array (specified through its name or the index in this field data).
 
bool GetFiniteRange (const char *name, double range[2], int comp=0)
 Computes the range of the input data array (specified through its name or the index in this field data).
 
bool GetFiniteRange (int index, double range[2], int comp=0)
 Computes the range of the input data array (specified through its name or the index in this field data).
 
virtual unsigned char GetGhostsToSkip ()
 Set / Get the binary mask filtering out certain types of ghosts when calling GetRange.
 
virtual void SetGhostsToSkip (unsigned char)
 Set / Get the binary mask filtering out certain types of ghosts when calling GetRange.
 
- 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)
 
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.
 
vtkCommandGetCommand (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 std::string GetObjectDescription () const
 The object description printed in messages and PrintSelf output.
 
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.
 
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.
 

Static Public Member Functions

static vtkFieldDataNew ()
 
static vtkFieldDataExtendedNew ()
 
static vtkTypeBool IsTypeOf (const char *type)
 
static vtkFieldDataSafeDownCast (vtkObjectBase *o)
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 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 vtkObjectBaseNew ()
 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.
 

Protected Types

using CachedGhostRangeType = std::tuple< vtkMTimeType, vtkMTimeType, std::vector< double > >
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkFieldData ()
 
 ~vtkFieldData () override
 
void SetArray (int i, vtkAbstractArray *array)
 Set an array to define the field.
 
virtual void InitializeFields ()
 Release all data but do not delete object.
 
void CopyFieldOnOff (const char *name, int onOff)
 
void ClearFieldFlags ()
 
int FindFlag (const char *field)
 
int GetFlag (const char *field)
 
void CopyFlags (const vtkFieldData *source)
 
- 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 *)
 
virtual void ObjectFinalize ()
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

int NumberOfArrays
 
int NumberOfActiveArrays
 
vtkAbstractArray ** Data
 
CopyFieldFlagCopyFieldFlags
 
int NumberOfFieldFlags
 
int DoCopyAllOn
 
int DoCopyAllOff
 
unsigned char GhostsToSkip
 
vtkUnsignedCharArrayGhostArray
 
std::vector< std::array< CachedGhostRangeType, 2 > > Ranges
 Ranges and FiniteRanges store cached ranges for arrays stored in this field data.
 
std::vector< std::array< CachedGhostRangeType, 2 > > FiniteRanges
 Ranges and FiniteRanges store cached ranges for arrays stored in this field data.
 
- 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
 

Additional Inherited Members

- Static Protected Member Functions inherited from vtkObjectBase
static vtkMallocingFunction GetCurrentMallocFunction ()
 
static vtkReallocingFunction GetCurrentReallocFunction ()
 
static vtkFreeingFunction GetCurrentFreeFunction ()
 
static vtkFreeingFunction GetAlternateFreeFunction ()
 

Detailed Description

represent and manipulate fields of data

vtkFieldData represents and manipulates fields of data. The model of a field is a m x n matrix of data values, where m is the number of tuples, and n is the number of components. (A tuple is a row of n components in the matrix.) The field is assumed to be composed of a set of one or more data arrays, where the data in the arrays are of different types (e.g., int, double, char, etc.), and there may be variable numbers of components in each array. Note that each data array is assumed to be "m" in length (i.e., number of tuples), which typically corresponds to the number of points or cells in a dataset. Also, each data array must have a character-string name. (This is used to manipulate data.)

There are two ways of manipulating and interfacing to fields. You can do it generically by manipulating components/tuples via a double-type data exchange, or you can do it by grabbing the arrays and manipulating them directly. The former is simpler but performs type conversion, which is bad if your data has non-castable types like (void) pointers, or you lose information as a result of the cast. The more efficient method means managing each array in the field. Using this method you can create faster, more efficient algorithms that do not lose information.

See also
vtkAbstractArray vtkDataSetAttributes vtkPointData vtkCellData
Online Examples:

Tests:
vtkFieldData (Tests)

Definition at line 161 of file vtkFieldData.h.

Member Typedef Documentation

◆ Superclass

Definition at line 167 of file vtkFieldData.h.

◆ CachedGhostRangeType

using vtkFieldData::CachedGhostRangeType = std::tuple<vtkMTimeType, vtkMTimeType, std::vector<double> >
protected

Definition at line 571 of file vtkFieldData.h.

Constructor & Destructor Documentation

◆ vtkFieldData()

vtkFieldData::vtkFieldData ( )
protected

◆ ~vtkFieldData()

vtkFieldData::~vtkFieldData ( )
overrideprotected

Member Function Documentation

◆ New()

static vtkFieldData * vtkFieldData::New ( )
static

◆ ExtendedNew()

static vtkFieldData * vtkFieldData::ExtendedNew ( )
static

◆ IsTypeOf()

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

◆ IsA()

virtual vtkTypeBool vtkFieldData::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class.

Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObjectBase.

Reimplemented in vtkCellData, vtkDataSetAttributes, and vtkPointData.

◆ SafeDownCast()

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

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkFieldData::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkFieldData * vtkFieldData::NewInstance ( ) const

◆ PrintSelf()

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

Methods invoked by print to print information about the object including superclasses.

Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObjectBase.

Reimplemented in vtkPointData.

◆ Initialize()

virtual void vtkFieldData::Initialize ( )
virtual

Release all data but do not delete object.

Also, clear the copy flags.

Reimplemented in vtkDataSetAttributes.

◆ Allocate()

vtkTypeBool vtkFieldData::Allocate ( vtkIdType  sz,
vtkIdType  ext = 1000 
)

Allocate data for each array.

Note that ext is no longer used.

◆ CopyStructure()

void vtkFieldData::CopyStructure ( vtkFieldData )

Copy data array structure from a given field.

The same arrays will exist with the same types, but will contain nothing in the copy.

◆ AllocateArrays()

void vtkFieldData::AllocateArrays ( int  num)

AllocateArrays actually sets the number of vtkAbstractArray pointers in the vtkFieldData object, not the number of used pointers (arrays).

Adding more arrays will cause the object to dynamically adjust the number of pointers if it needs to extend. Although AllocateArrays can be used if the number of arrays which will be added is known, it can be omitted with a small computation cost.

◆ GetNumberOfArrays()

int vtkFieldData::GetNumberOfArrays ( )
inline

Get the number of arrays of data available.

This does not include nullptr array pointers therefore after fd->AllocateArray(n); nArrays = GetNumberOfArrays(); nArrays is not necessarily equal to n.

Definition at line 206 of file vtkFieldData.h.

◆ AddArray()

int vtkFieldData::AddArray ( vtkAbstractArray array)

Add an array to the array list.

If an array with the same name already exists - then the added array will replace it. Return the index of the added array. If the given array is nullptr, does nothing and returns -1.

◆ NullData()

void vtkFieldData::NullData ( vtkIdType  id)

Sets every vtkDataArray at index id to a null tuple.

◆ RemoveArray() [1/2]

virtual void vtkFieldData::RemoveArray ( const char *  name)
virtual

Remove an array (with the given name) from the list of arrays.

Reimplemented in vtkDataSetAttributes.

◆ RemoveArray() [2/2]

virtual void vtkFieldData::RemoveArray ( int  index)
virtual

Remove an array (with the given index) from the list of arrays.

Reimplemented in vtkDataSetAttributes, and vtkDataSetAttributes.

◆ GetArray() [1/3]

vtkDataArray * vtkFieldData::GetArray ( int  i)

Not recommended for use.

Use GetAbstractArray(int i) instead.

Return the ith array in the field. A nullptr is returned if the index i is out of range, or if the array at the given index is not a vtkDataArray. To access vtkStringArray, or vtkVariantArray, use GetAbstractArray(int i).

◆ GetArray() [2/3]

vtkDataArray * vtkFieldData::GetArray ( const char *  arrayName,
int &  index 
)

Not recommended for use.

Use GetAbstractArray(const char *arrayName, int &index) instead.

Return the array with the name given. Returns nullptr if array not found. A nullptr is also returned if the array with the given name is not a vtkDataArray. To access vtkStringArray, or vtkVariantArray, use GetAbstractArray(const char* arrayName, int &index). Also returns the index of the array if found, -1 otherwise.

◆ GetArray() [3/3]

vtkDataArray * vtkFieldData::GetArray ( const char *  arrayName)
inline

Not recommended for use.

Use GetAbstractArray(const char *arrayName) instead.

Return the array with the name given. Returns nullptr if array not found. A nullptr is also returned if the array with the given name is not a vtkDataArray. To access vtkStringArray, or vtkVariantArray, use GetAbstractArray(const char *arrayName).

Definition at line 265 of file vtkFieldData.h.

◆ GetAbstractArray() [1/3]

vtkAbstractArray * vtkFieldData::GetAbstractArray ( int  i)

Returns the ith array in the field.

Unlike GetArray(), this method returns a vtkAbstractArray and can be used to access any array type. A nullptr is returned only if the index i is out of range.

◆ GetAbstractArray() [2/3]

vtkAbstractArray * vtkFieldData::GetAbstractArray ( const char *  arrayName,
int &  index 
)

Return the array with the name given.

Returns nullptr if array not found. Unlike GetArray(), this method returns a vtkAbstractArray and can be used to access any array type. Also returns index of array if found, -1 otherwise.

◆ GetAbstractArray() [3/3]

vtkAbstractArray * vtkFieldData::GetAbstractArray ( const char *  arrayName)
inline

Return the array with the name given.

Returns nullptr if array not found. Unlike GetArray(), this method returns a vtkAbstractArray and can be used to access any array type.

Definition at line 293 of file vtkFieldData.h.

◆ HasArray()

vtkTypeBool vtkFieldData::HasArray ( const char *  name)
inline

Return 1 if an array with the given name could be found.

0 otherwise.

Definition at line 304 of file vtkFieldData.h.

◆ GetArrayName()

const char * vtkFieldData::GetArrayName ( int  i)
inline

Get the name of ith array.

Note that this is equivalent to: GetAbstractArray(i)->GetName() if ith array pointer is not nullptr

Definition at line 318 of file vtkFieldData.h.

◆ PassData()

virtual void vtkFieldData::PassData ( vtkFieldData fd)
virtual

Pass entire arrays of input data through to output.

Obey the "copy" flags.

Reimplemented in vtkDataSetAttributes.

◆ CopyFieldOn()

void vtkFieldData::CopyFieldOn ( const char *  name)
inline

Turn on/off the copying of the field specified by name.

During the copying/passing, the following rules are followed for each array:

  1. If the copy flag for an array is set (on or off), it is applied. This overrides rule 2.
  2. If CopyAllOn is set, copy the array. If CopyAllOff is set, do not copy the array.

Definition at line 340 of file vtkFieldData.h.

◆ CopyFieldOff()

void vtkFieldData::CopyFieldOff ( const char *  name)
inline

Definition at line 341 of file vtkFieldData.h.

◆ CopyAllOn()

virtual void vtkFieldData::CopyAllOn ( int  unused = 0)
virtual

Turn on copying of all data.

During the copying/passing, the following rules are followed for each array:

  1. If the copy flag for an array is set (on or off), it is applied. This overrides rule 2.
  2. If CopyAllOn is set, copy the array. If CopyAllOff is set, do not copy the array.

Reimplemented in vtkDataSetAttributes.

◆ CopyAllOff()

virtual void vtkFieldData::CopyAllOff ( int  unused = 0)
virtual

Turn off copying of all data.

During the copying/passing, the following rules are followed for each array:

  1. If the copy flag for an array is set (on or off), it is applied. This overrides rule 2.
  2. If CopyAllOn is set, copy the array. If CopyAllOff is set, do not copy the array.

Reimplemented in vtkDataSetAttributes.

◆ DeepCopy()

virtual void vtkFieldData::DeepCopy ( vtkFieldData da)
virtual

Copy a field by creating new data arrays (i.e., duplicate storage).

Reimplemented in vtkDataSetAttributes.

◆ ShallowCopy()

virtual void vtkFieldData::ShallowCopy ( vtkFieldData da)
virtual

Copy a field by reference counting the data arrays.

Reimplemented in vtkDataSetAttributes.

◆ Squeeze()

void vtkFieldData::Squeeze ( )

Squeezes each data array in the field (Squeeze() reclaims unused memory.)

◆ Reset()

void vtkFieldData::Reset ( )

Resets each data array in the field (Reset() does not release memory but it makes the arrays look like they are empty.)

◆ GetActualMemorySize()

virtual unsigned long vtkFieldData::GetActualMemorySize ( )
virtual

Return the memory in kibibytes (1024 bytes) consumed by this field data.

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.

◆ GetMTime()

vtkMTimeType vtkFieldData::GetMTime ( )
overridevirtual

Check object's components for modified times.

Reimplemented from vtkObject.

◆ GetField()

void vtkFieldData::GetField ( vtkIdList ptId,
vtkFieldData f 
)

Get a field from a list of ids.

Supplied field f should have same types and number of data arrays as this one (i.e., like CopyStructure() creates). This method should not be used if the instance is from a subclass of vtkFieldData (vtkPointData or vtkCellData). This is because in those cases, the attribute data is stored with the other fields and will cause the method to behave in an unexpected way.

◆ GetArrayContainingComponent()

int vtkFieldData::GetArrayContainingComponent ( int  i,
int &  arrayComp 
)

Return the array containing the ith component of the field.

The return value is an integer number n 0<=n<this->NumberOfArrays. Also, an integer value is returned indicating the component in the array is returned. Method returns -1 if specified component is not in the field.

◆ GetNumberOfComponents()

int vtkFieldData::GetNumberOfComponents ( )

Get the number of components in the field.

This is determined by adding up the components in each non-nullptr array. This method should not be used if the instance is from a subclass of vtkFieldData (vtkPointData or vtkCellData). This is because in those cases, the attribute data is stored with the other fields and will cause the method to behave in an unexpected way.

◆ GetNumberOfTuples()

vtkIdType vtkFieldData::GetNumberOfTuples ( )

Get the number of tuples in the field.

Note: some fields have arrays with different numbers of tuples; this method returns the number of tuples in the first array. Mixed-length arrays may have to be treated specially. This method should not be used if the instance is from a subclass of vtkFieldData (vtkPointData or vtkCellData). This is because in those cases, the attribute data is stored with the other fields and will cause the method to behave in an unexpected way.

◆ SetNumberOfTuples()

void vtkFieldData::SetNumberOfTuples ( vtkIdType  number)

Set the number of tuples for each data array in the field.

This method should not be used if the instance is from a subclass of vtkFieldData (vtkPointData or vtkCellData). This is because in those cases, the attribute data is stored with the other fields and will cause the method to behave in an unexpected way.

◆ SetTuple()

void vtkFieldData::SetTuple ( vtkIdType  i,
vtkIdType  j,
vtkFieldData source 
)

Set the jth tuple in source field data at the ith location.

Set operations mean that no range checking is performed, so they're faster.

◆ InsertTuple()

void vtkFieldData::InsertTuple ( vtkIdType  i,
vtkIdType  j,
vtkFieldData source 
)

Insert the jth tuple in source field data at the ith location.

Range checking is performed and memory allocates as necessary.

◆ InsertNextTuple()

vtkIdType vtkFieldData::InsertNextTuple ( vtkIdType  j,
vtkFieldData source 
)

Insert the jth tuple in source field data at the end of the tuple matrix.

Range checking is performed and memory is allocated as necessary.

◆ GetRange() [1/2]

bool vtkFieldData::GetRange ( const char *  name,
double  range[2],
int  comp = 0 
)

Computes the range of the input data array (specified through its name or the index in this field data).

If the targeted array is not polymorphic with a vtkDataArray, or if no array match the input name or index, or if comp is out of bounds, then the returned range is [NaN, NaN].

The computed range is cached to avoid recomputing it. The range is recomputed if the held array has been modified, if GhostsToSkip has been changed, or if the ghost array has been changed / modified.

If a ghost array is present in the field data, then the binary mask GhostsToSkip is used to skip values associated with a ghost that intersects this mask.

comp targets which component of the array the range is to be computed on. Setting it to -1 results in computing the range of the magnitude of the array.

The Finite version of this method skips infinite values in the array in addition to ghosts matching with GhostsToSkip.

◆ GetRange() [2/2]

bool vtkFieldData::GetRange ( int  index,
double  range[2],
int  comp = 0 
)

Computes the range of the input data array (specified through its name or the index in this field data).

If the targeted array is not polymorphic with a vtkDataArray, or if no array match the input name or index, or if comp is out of bounds, then the returned range is [NaN, NaN].

The computed range is cached to avoid recomputing it. The range is recomputed if the held array has been modified, if GhostsToSkip has been changed, or if the ghost array has been changed / modified.

If a ghost array is present in the field data, then the binary mask GhostsToSkip is used to skip values associated with a ghost that intersects this mask.

comp targets which component of the array the range is to be computed on. Setting it to -1 results in computing the range of the magnitude of the array.

The Finite version of this method skips infinite values in the array in addition to ghosts matching with GhostsToSkip.

◆ GetFiniteRange() [1/2]

bool vtkFieldData::GetFiniteRange ( const char *  name,
double  range[2],
int  comp = 0 
)

Computes the range of the input data array (specified through its name or the index in this field data).

If the targeted array is not polymorphic with a vtkDataArray, or if no array match the input name or index, or if comp is out of bounds, then the returned range is [NaN, NaN].

The computed range is cached to avoid recomputing it. The range is recomputed if the held array has been modified, if GhostsToSkip has been changed, or if the ghost array has been changed / modified.

If a ghost array is present in the field data, then the binary mask GhostsToSkip is used to skip values associated with a ghost that intersects this mask.

comp targets which component of the array the range is to be computed on. Setting it to -1 results in computing the range of the magnitude of the array.

The Finite version of this method skips infinite values in the array in addition to ghosts matching with GhostsToSkip.

◆ GetFiniteRange() [2/2]

bool vtkFieldData::GetFiniteRange ( int  index,
double  range[2],
int  comp = 0 
)

Computes the range of the input data array (specified through its name or the index in this field data).

If the targeted array is not polymorphic with a vtkDataArray, or if no array match the input name or index, or if comp is out of bounds, then the returned range is [NaN, NaN].

The computed range is cached to avoid recomputing it. The range is recomputed if the held array has been modified, if GhostsToSkip has been changed, or if the ghost array has been changed / modified.

If a ghost array is present in the field data, then the binary mask GhostsToSkip is used to skip values associated with a ghost that intersects this mask.

comp targets which component of the array the range is to be computed on. Setting it to -1 results in computing the range of the magnitude of the array.

The Finite version of this method skips infinite values in the array in addition to ghosts matching with GhostsToSkip.

◆ GetGhostsToSkip()

virtual unsigned char vtkFieldData::GetGhostsToSkip ( )
virtual

Set / Get the binary mask filtering out certain types of ghosts when calling GetRange.

By default, it is set to 0xff for pure vtkFieldData. In vtkCellData, it is set to HIDDENCELL and in vtkPointData, it is set to HIDDENPOINT by default. See vtkDataSetAttributes for more context on ghost types definitions.

See also
vtkDataSetAttributes vtkPointData vtkCellData

◆ SetGhostsToSkip()

virtual void vtkFieldData::SetGhostsToSkip ( unsigned char  )
virtual

Set / Get the binary mask filtering out certain types of ghosts when calling GetRange.

By default, it is set to 0xff for pure vtkFieldData. In vtkCellData, it is set to HIDDENCELL and in vtkPointData, it is set to HIDDENPOINT by default. See vtkDataSetAttributes for more context on ghost types definitions.

See also
vtkDataSetAttributes vtkPointData vtkCellData

◆ HasAnyGhostBitSet()

bool vtkFieldData::HasAnyGhostBitSet ( int  bitFlag)

Helper function that tests if any of the values in ghost array has been set.

The test performed is (value & bitFlag).

◆ GetGhostArray()

virtual vtkUnsignedCharArray * vtkFieldData::GetGhostArray ( )
virtual

Get the ghost array, if present in this field data.

If no ghost array is set, returns nullptr. A ghost array is a vtkUnsignedCharArray called vtkGhostType. See vtkDataSetAttributes for more context on ghost types.

See also
vtkDataSetAttributes

◆ SetArray()

void vtkFieldData::SetArray ( int  i,
vtkAbstractArray array 
)
protected

Set an array to define the field.

◆ InitializeFields()

virtual void vtkFieldData::InitializeFields ( )
protectedvirtual

Release all data but do not delete object.

Reimplemented in vtkDataSetAttributes.

◆ CopyFieldOnOff()

void vtkFieldData::CopyFieldOnOff ( const char *  name,
int  onOff 
)
protected

◆ ClearFieldFlags()

void vtkFieldData::ClearFieldFlags ( )
protected

◆ FindFlag()

int vtkFieldData::FindFlag ( const char *  field)
protected

◆ GetFlag()

int vtkFieldData::GetFlag ( const char *  field)
protected

◆ CopyFlags()

void vtkFieldData::CopyFlags ( const vtkFieldData source)
protected

Member Data Documentation

◆ NumberOfArrays

int vtkFieldData::NumberOfArrays
protected

Definition at line 534 of file vtkFieldData.h.

◆ NumberOfActiveArrays

int vtkFieldData::NumberOfActiveArrays
protected

Definition at line 535 of file vtkFieldData.h.

◆ Data

vtkAbstractArray** vtkFieldData::Data
protected

Definition at line 536 of file vtkFieldData.h.

◆ CopyFieldFlags

CopyFieldFlag* vtkFieldData::CopyFieldFlags
protected

Definition at line 554 of file vtkFieldData.h.

◆ NumberOfFieldFlags

int vtkFieldData::NumberOfFieldFlags
protected

Definition at line 555 of file vtkFieldData.h.

◆ DoCopyAllOn

int vtkFieldData::DoCopyAllOn
protected

Definition at line 561 of file vtkFieldData.h.

◆ DoCopyAllOff

int vtkFieldData::DoCopyAllOff
protected

Definition at line 562 of file vtkFieldData.h.

◆ GhostsToSkip

unsigned char vtkFieldData::GhostsToSkip
protected

Definition at line 572 of file vtkFieldData.h.

◆ GhostArray

vtkUnsignedCharArray* vtkFieldData::GhostArray
protected

Definition at line 573 of file vtkFieldData.h.

◆ Ranges

std::vector<std::array<CachedGhostRangeType, 2> > vtkFieldData::Ranges
protected

Ranges and FiniteRanges store cached ranges for arrays stored in this field data.

Given the array at index idx, 2 ranges are stored: the magnitude range at Ranges[idx][0], and all the component ranges at Ranges[idx][1]. The ranges are stored in the third component of the tuple CachedGhostRangeType. For the component ranges, they are stored in an array of size 2 times the number of components, storing [min0, max0, ..., minn, maxn].

Definition at line 583 of file vtkFieldData.h.

◆ FiniteRanges

std::vector<std::array<CachedGhostRangeType, 2> > vtkFieldData::FiniteRanges
protected

Ranges and FiniteRanges store cached ranges for arrays stored in this field data.

Given the array at index idx, 2 ranges are stored: the magnitude range at Ranges[idx][0], and all the component ranges at Ranges[idx][1]. The ranges are stored in the third component of the tuple CachedGhostRangeType. For the component ranges, they are stored in an array of size 2 times the number of components, storing [min0, max0, ..., minn, maxn].

Definition at line 584 of file vtkFieldData.h.


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