17 #ifndef vtkCellAttribute_h
18 #define vtkCellAttribute_h
20 #include "vtkCommonDataModelModule.h"
26 #include <unordered_map>
28 VTK_ABI_NAMESPACE_BEGIN
38 using ArraysForCellType = std::unordered_map<vtkStringToken, vtkSmartPointer<vtkAbstractArray>>;
73 template <
typename ArrayType>
76 auto it = this->ArraysByRole.find(role);
77 if (it == this->ArraysByRole.end())
81 return ArrayType::SafeDownCast(it->second);
93 using Arrays = std::unordered_map<vtkStringToken, CellTypeInfo>;
108 vtkGetMacro(Id,
int);
109 vtkSetMacro(Id,
int);
165 virtual CellTypeInfo GetCellTypeInfo(
vtkStringToken cellType)
const;
184 virtual bool SetCellTypeInfo(
vtkStringToken cellType,
const CellTypeInfo& cellTypeInfo);
209 const std::map<vtkAbstractArray*, vtkAbstractArray*>& arrayRewrites = {});
221 static bool DecodeSpace(
233 int NumberOfComponents = 1;
243 VTK_ABI_NAMESPACE_END
virtual vtkStringToken GetName() const
Return the (user-presentable) name of this attribute.
vtkStringToken DOFSharing
abstract base class for most VTK objects
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
std::unordered_map< vtkStringToken, vtkSmartPointer< vtkAbstractArray >> ArraysForCellType
A dictionary of arrays indexed by their roles in interpolation.
vtkSmartPointer< vtkScalarsToColors > Colormap
Abstract superclass for all arrays.
virtual int GetNumberOfComponents() const
Return the number of components this function provides at each point in space.
std::unordered_map< vtkStringToken, CellTypeInfo > Arrays
virtual vtkStringToken GetSpace() const
Return a token identifying the space containing all field values.
Superclass for mapping scalar values to colors.
vtkStringToken FunctionSpace
The function space used to interpolate values of the attribute on cells of the matching type...
Visualization data composed of cells of arbitrary type.
a simple class to control print indentation
A function defined over the physical domain of a vtkCellGrid.
bool VTKCOMMONCORE_EXPORT operator!=(const std::string &a, const vtkStringToken &b)
vtkStringToken Basis
The interpolation scheme of the attribute on cells of the matching type.
represent and manipulate attribute data in a dataset
Represent a string by its integer hash.
ArrayType * GetArrayForRoleAs(vtkStringToken role) const
Return an array (or nullptr) given a role, cast to ArrayType.
vtkScalarsToColors * GetColormap() const
Return a default colormap associated with the attribute.
int Order
The interpolation order of the attribute on cells of the matching type.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
ArraysForCellType ArraysByRole
A dictionary of arrays indexed by their roles in interpolation.