VTK  9.3.20240327
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vtkCellAttribute Class Reference

A function defined over the physical domain of a vtkCellGrid. More...

#include <vtkCellAttribute.h>

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

Public Types

using ArraysForCellType = std::unordered_map< vtkStringToken, vtkSmartPointer< vtkAbstractArray > >
 
using Arrays = std::unordered_map< vtkStringToken, ArraysForCellType >
 
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. More...
 
vtkCellAttributeNewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual vtkStringToken GetName () const
 Return the (user-presentable) name of this attribute. More...
 
virtual int GetId ()
 Return a (cell-grid-assigned) integer identifier for this attribute. More...
 
virtual void SetId (int)
 
virtual vtkStringToken GetAttributeType () const
 Return a (user-presentable) type for this attribute. More...
 
virtual vtkStringToken GetSpace () const
 Return a token identifying the space containing all field values. More...
 
virtual int GetNumberOfComponents () const
 Return the number of components this function provides at each point in space. More...
 
virtual bool Initialize (vtkStringToken name, vtkStringToken attributeType, vtkStringToken space, int numberOfComponents)
 Initialize an attribute. More...
 
virtual vtkStringToken::Hash GetHash () const
 Hash this attribute so it can be inserted into unordered containers. More...
 
virtual ArraysForCellType GetArraysForCellType (vtkStringToken cellType) const
 Return the arrays required to evaluate this attribute on cells of the given type. More...
 
vtkAbstractArrayGetArrayForCellTypeAndRole (vtkStringToken cellType, vtkStringToken arrayRole) const
 Return an array for the given cell type and role. More...
 
virtual bool SetArraysForCellType (vtkStringToken cellType, const ArraysForCellType &arrays)
 Set the arrays required to evaluate this attribute on cells of the given type. More...
 
vtkScalarsToColorsGetColormap () const
 Return a default colormap associated with the attribute. More...
 
bool SetColormap (vtkScalarsToColors *colormap)
 
virtual void ShallowCopy (vtkCellAttribute *other)
 Copy data from an other attribute instance into this instance. More...
 
virtual void DeepCopy (vtkCellAttribute *other, const std::map< vtkAbstractArray *, vtkAbstractArray * > &arrayRewrites={})
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on. More...
 
virtual void DebugOff ()
 Turn debugging output off. More...
 
bool GetDebug ()
 Get the value of the debug flag. More...
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag. More...
 
virtual void Modified ()
 Update the modification time for this object. More...
 
virtual vtkMTimeType GetMTime ()
 Return this object's modified time. More...
 
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. More...
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkCommandGetCommand (unsigned long tag)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObserver (vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
void RemoveObservers (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkTypeBool HasObserver (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
vtkTypeBool HasObserver (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object. More...
 
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. More...
 
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. More...
 
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. More...
 
vtkTypeBool InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
vtkTypeBool InvokeEvent (const char *event, void *callData)
 This method invokes an event and return whether the event was aborted or not. More...
 
virtual void SetObjectName (const std::string &objectName)
 Set/get the name of this object for reporting purposes. More...
 
virtual std::string GetObjectName () const
 Set/get the name of this object for reporting purposes. More...
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string. More...
 
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). More...
 
virtual void Delete ()
 Delete a VTK object. More...
 
virtual void FastDelete ()
 Delete a reference to this object. More...
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream. More...
 
void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object). More...
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object). More...
 
int GetReferenceCount ()
 Return the current reference count of this object. More...
 
void SetReferenceCount (int)
 Sets the reference count. More...
 
bool GetIsInMemkind () const
 A local state flag that remembers whether this object lives in the normal or extended memory space. More...
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses. More...
 
virtual bool UsesGarbageCollector () const
 Indicate whether the class uses vtkGarbageCollector or not. More...
 

Static Public Member Functions

static vtkTypeBool IsTypeOf (const char *type)
 
static vtkCellAttributeSafeDownCast (vtkObjectBase *o)
 
static vtkCellAttributeNew ()
 
- 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. More...
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes. More...
 
static void SetGlobalWarningDisplay (vtkTypeBool val)
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOn ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static void GlobalWarningDisplayOff ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
static vtkTypeBool GetGlobalWarningDisplay ()
 This is a global flag that controls whether any debug, warning or error messages are displayed. More...
 
- 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. More...
 
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). More...
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on. More...
 
static void SetMemkindDirectory (const char *directoryname)
 The name of a directory, ideally mounted -o dax, to memory map an extended memory space within. More...
 
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. More...
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
 vtkCellAttribute ()=default
 
 ~vtkCellAttribute () override=default
 
- 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. More...
 
void InternalReleaseFocus ()
 These methods allow a command to exclusively grab all events. More...
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void ReportReferences (vtkGarbageCollector *)
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Protected Attributes

vtkStringToken Name
 
vtkStringToken AttributeType
 
vtkStringToken Space
 
int NumberOfComponents = 1
 
Arrays AllArrays
 
int Id = -1
 
vtkSmartPointer< vtkScalarsToColorsColormap
 
- 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

A function defined over the physical domain of a vtkCellGrid.

This is a base class for attributes (functions) defined on the space discretized by a vtkCellGrid. A vtkCellAttribute class must handle cells of all types present in the grid.

See also
vtkCellGrid

Definition at line 31 of file vtkCellAttribute.h.

Member Typedef Documentation

◆ ArraysForCellType

Definition at line 34 of file vtkCellAttribute.h.

◆ Arrays

Definition at line 35 of file vtkCellAttribute.h.

◆ Superclass

Definition at line 37 of file vtkCellAttribute.h.

Constructor & Destructor Documentation

◆ vtkCellAttribute()

vtkCellAttribute::vtkCellAttribute ( )
protecteddefault

◆ ~vtkCellAttribute()

vtkCellAttribute::~vtkCellAttribute ( )
overrideprotecteddefault

Member Function Documentation

◆ IsTypeOf()

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

◆ IsA()

virtual vtkTypeBool vtkCellAttribute::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.

◆ SafeDownCast()

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

◆ NewInstanceInternal()

virtual vtkObjectBase* vtkCellAttribute::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkCellAttribute* vtkCellAttribute::NewInstance ( ) const

◆ New()

static vtkCellAttribute* vtkCellAttribute::New ( )
static

◆ PrintSelf()

void vtkCellAttribute::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 vtkObject.

◆ GetName()

virtual vtkStringToken vtkCellAttribute::GetName ( ) const
inlinevirtual

Return the (user-presentable) name of this attribute.

Definition at line 42 of file vtkCellAttribute.h.

◆ GetId()

virtual int vtkCellAttribute::GetId ( )
virtual

Return a (cell-grid-assigned) integer identifier for this attribute.

Do not call SetId() unless you represent a vtkCellGrid taking ownership of this attribute instance.

◆ SetId()

virtual void vtkCellAttribute::SetId ( int  )
virtual

◆ GetAttributeType()

virtual vtkStringToken vtkCellAttribute::GetAttributeType ( ) const
inlinevirtual

Return a (user-presentable) type for this attribute.

The type should reflect the nature of the function and may reflect the nature of the cell shapes supported.

The type is distinct from the space in which values reside; instead it describes the mathematical technique used to interpolate values (e.g., "rational spline", "polynomial", "partition of unity", "stochastic", etc.), behavior at cell boundaries, and other relevant information. For example, a quadratic field that allows discontinuities at cell boundaries and uses H(Grad) Lagrange interpolation of arbitrary order (i.e., order may differ per cell) might return "DG HGRAD [CI]n", where "n" indicates the integration order is arbitrary. The "C" or "I" preceding the order indicates the basis is "complete (C)" or "incomplete (I)."

Currently, this is just a free-form string but in the future we may adopt a more rigorous standard.

Definition at line 74 of file vtkCellAttribute.h.

◆ GetSpace()

virtual vtkStringToken vtkCellAttribute::GetSpace ( ) const
inlinevirtual

Return a token identifying the space containing all field values.

Currently, this is just a free-form string but in the future we may adopt a more rigorous standard.

Some suggested values

  • "ℝ¹" – single (scalar) values over the real numbers.
  • "ℝ¹+" – single (scalar) values over the non-negative real numbers.
  • "ℝ²" – 2-d vector values over the real numbers.
  • "ℝ³" – 3-d vector values over the real numbers.
  • "𝕊³" – points inside a unit 3-dimensional ball.
  • "S²" – points on the surface of a unit 3-dimensional sphere.
  • "SO(3)" – rotation matrices.
  • "SU(2)" – special unitary group (homeomorphic to SO(3)).

Note that the space might imply the number of components but it also specifies how users should interpret operations such as addition and/or multipliciation, especially in the case of transforms applied to the domain.

Definition at line 97 of file vtkCellAttribute.h.

◆ GetNumberOfComponents()

virtual int vtkCellAttribute::GetNumberOfComponents ( ) const
inlinevirtual

Return the number of components this function provides at each point in space.

This should be consistent with the value returned by GetSpace().

Definition at line 105 of file vtkCellAttribute.h.

◆ Initialize()

virtual bool vtkCellAttribute::Initialize ( vtkStringToken  name,
vtkStringToken  attributeType,
vtkStringToken  space,
int  numberOfComponents 
)
virtual

Initialize an attribute.

Never call this method after a cell-attribute has been inserted into an unordered container as it will change the reported hash, which can cause crashes later.

◆ GetHash()

virtual vtkStringToken::Hash vtkCellAttribute::GetHash ( ) const
virtual

Hash this attribute so it can be inserted into unordered containers.

The hash includes the name, type, space, and number of components.

◆ GetArraysForCellType()

virtual ArraysForCellType vtkCellAttribute::GetArraysForCellType ( vtkStringToken  cellType) const
virtual

Return the arrays required to evaluate this attribute on cells of the given type.

◆ GetArrayForCellTypeAndRole()

vtkAbstractArray* vtkCellAttribute::GetArrayForCellTypeAndRole ( vtkStringToken  cellType,
vtkStringToken  arrayRole 
) const

Return an array for the given cell type and role.

This is a convenience for use in language bindings like Python.

◆ SetArraysForCellType()

virtual bool vtkCellAttribute::SetArraysForCellType ( vtkStringToken  cellType,
const ArraysForCellType arrays 
)
virtual

Set the arrays required to evaluate this attribute on cells of the given type.

TODO: Instead of accepting a fixed type (ArraysForCellType), this method should be templated to accept any object so that cell types can put whatever state is needed here in order to assist in evaluating the attribute.

◆ GetColormap()

vtkScalarsToColors* vtkCellAttribute::GetColormap ( ) const
inline

Return a default colormap associated with the attribute.

Definition at line 150 of file vtkCellAttribute.h.

◆ SetColormap()

bool vtkCellAttribute::SetColormap ( vtkScalarsToColors colormap)

◆ ShallowCopy()

virtual void vtkCellAttribute::ShallowCopy ( vtkCellAttribute other)
virtual

Copy data from an other attribute instance into this instance.

Currently, the only difference between shallow and deep copies is that the colormap is copied by reference when shallow-copying and a cloned instance is created when deep-copying.

Note that the list of array pointers is copied by reference (even when deep-copying a vtkCellAttribute) unless you provide DeepCopy() with a map of arrayRewrites pointers. The vtkCellGrid owns the arrays, not the vtkCellAttribute, so the when deep-copying a vtkCellGrid, it will have a map of array copies it has created. If any array is mentioned in AllArrays and is not present in arrayRewrites, it is copied by reference.

◆ DeepCopy()

virtual void vtkCellAttribute::DeepCopy ( vtkCellAttribute other,
const std::map< vtkAbstractArray *, vtkAbstractArray * > &  arrayRewrites = {} 
)
virtual

Member Data Documentation

◆ Name

vtkStringToken vtkCellAttribute::Name
protected

Definition at line 176 of file vtkCellAttribute.h.

◆ AttributeType

vtkStringToken vtkCellAttribute::AttributeType
protected

Definition at line 177 of file vtkCellAttribute.h.

◆ Space

vtkStringToken vtkCellAttribute::Space
protected

Definition at line 178 of file vtkCellAttribute.h.

◆ NumberOfComponents

int vtkCellAttribute::NumberOfComponents = 1
protected

Definition at line 179 of file vtkCellAttribute.h.

◆ AllArrays

Arrays vtkCellAttribute::AllArrays
protected

Definition at line 180 of file vtkCellAttribute.h.

◆ Id

int vtkCellAttribute::Id = -1
protected

Definition at line 181 of file vtkCellAttribute.h.

◆ Colormap

vtkSmartPointer<vtkScalarsToColors> vtkCellAttribute::Colormap
protected

Definition at line 182 of file vtkCellAttribute.h.


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