33#include <unordered_map>
35VTK_ABI_NAMESPACE_BEGIN
89 const std::unordered_map<int, vtkSmartPointer<vtkDataSetAttributes>>&
GetArrayGroups()
const
91 return this->ArrayGroups;
137 template <
typename CellType>
140 CellType* result = this->GetCellsOfType<CellType>();
146 if (metadata->SetCellGrid(
this))
148 auto ok = this->Cells.insert(
149 std::make_pair(
vtkStringToken(vtk::TypeName<CellType>()).GetId(), metadata));
152 result = ok.first.GetPointer();
165 template <
typename CellType>
168 auto it = this->Cells.find(
vtkStringToken(vtk::TypeName<CellType>()).GetId());
169 if (it == this->Cells.end())
173 return static_cast<const CellType*
>(it->second);
175 template <
typename CellType>
178 auto it = this->Cells.find(
vtkStringToken(vtk::TypeName<CellType>()).GetId());
179 if (it == this->Cells.end())
183 return static_cast<CellType*
>(it->second);
191 template <
typename Container>
194 for (
const auto& entry : this->Cells)
196 cellTypes.insert(cellTypes.end(), entry.first);
199 template <
typename Container>
203 this->CellTypes(cellTypes);
208#if defined(_MSC_VER) && _MSC_VER >= 1930 && _MSC_VER < 1940
213 static std::vector<vtkStringToken> cellTypes;
215 static thread_local std::vector<vtkStringToken> cellTypes;
217 this->CellTypes(cellTypes);
301 std::unordered_map<int, vtkSmartPointer<vtkDataSetAttributes>>
ArrayGroups;
302 std::unordered_map<CellTypeId, vtkSmartPointer<vtkCellMetadata>>
Cells;
303 std::unordered_map<vtkStringToken::Hash, vtkSmartPointer<vtkCellAttribute>>
Attributes;
304 int NextAttribute = 0;
306 bool HaveShape{
false };
Abstract superclass for all arrays.
A function defined over the physical domain of a vtkCellGrid.
Perform an operation on cells in a vtkCellMetadata instance.
Visualization data composed of cells of arbitrary type.
void Initialize() override
Restore data object to initial state,.
vtkDataSetAttributes * GetAttributes(vtkStringToken type)
Fetch a partition of DOF arrays.
vtkIdType GetNumberOfElements(int type) override
Get the number of elements for a specific attribute type (POINT, CELL, etc.).
int GetAttributeTypeForArray(vtkAbstractArray *arr) override
Retrieves the attribute type that an array came from.
vtkIdType GetNumberOfCells()
Return the number of cells (of all types).
bool ComputeBoundsInternal()
void DeepCopy(vtkDataObject *baseSrc) override
Shallow and Deep copy.
unsigned long GetActualMemorySize() override
Return the actual size of the data in kibibytes (1024 bytes).
std::unordered_map< int, vtkSmartPointer< vtkDataSetAttributes > > ArrayGroups
CellType * GetCellsOfType()
Get a cell metadata object of the given type.
vtkDataSetAttributes * FindAttributes(int type) const
Fetch a partition of DOF arrays.
std::vector< vtkStringToken > CellTypeArray() const
Fill a container with all the cell types (as string tokens).
vtkCellMetadata * GetCellType(vtkStringToken cellTypeName)
Return an object that can operate on this vtkCellGrid's cells of the given type.
bool SetShapeAttribute(vtkCellAttribute *shape)
Set/get the "shape attribute" (i.e., a vector-valued cell-attribute that maps from reference to world...
void ShallowCopy(vtkDataObject *baseSrc) override
Shallow and Deep copy.
vtkCellAttribute * GetCellAttributeByName(const std::string &name)
Return an attribute given its name or identifier.
virtual bool AddCellAttribute(vtkCellAttribute *attribute)
Add a cell-attribute to the dataset.
CellType * AddCellMetadata()
Insert a cell type, if possible.
const CellType * GetCellsOfType() const
Get a cell metadata object of the given type.
int GetDataObjectType() override
Return class name of data type.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
bool Query(vtkCellGridQuery *query)
Perform a query on all the cells in this instance.
void CellTypes(Container &cellTypes) const
Fill a container with all the cell types (as string tokens).
static vtkCellGrid * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
std::array< double, 6 > CachedBounds
const std::unordered_map< int, vtkSmartPointer< vtkDataSetAttributes > > & GetArrayGroups() const
Fetch a partition of DOF arrays.
std::unordered_map< vtkStringToken::Hash, vtkSmartPointer< vtkCellAttribute > > Attributes
vtkTimeStamp CachedBoundsTime
vtkCellMetadata * AddCellMetadata(vtkCellMetadata *cellType)
Insert a cell type, if possible.
static vtkCellGrid * New()
vtkCellAttribute * GetCellAttributeById(int attributeId)
Return an attribute given its name or identifier.
vtkStringToken ShapeAttribute
std::unordered_map< CellTypeId, vtkSmartPointer< vtkCellMetadata > > Cells
vtkCellAttribute * GetShapeAttribute()
Set/get the "shape attribute" (i.e., a vector-valued cell-attribute that maps from reference to world...
static vtkCellGrid * GetData(vtkInformationVector *v, int i=0)
Retrieve an instance of this class from an information object.
void GetBounds(double bounds[6])
Fill the provided bounding box with the bounds of all the cells present in the grid.
Container CellTypes() const
Fill a container with all the cell types (as string tokens).
vtkUnsignedCharArray * GetGhostArray(int type) override
Returns the ghost arrays of the data object of the specified attribute type.
const vtkCellMetadata * GetCellType(vtkStringToken cellTypeName) const
Return an object that can operate on this vtkCellGrid's cells of the given type.
vtkDataSetAttributes * GetAttributes(int type) override
Fetch a partition of DOF arrays.
general representation of visualization data
represent and manipulate attribute data in a dataset
a simple class to control print indentation
static vtkSmartPointer< T > New()
Create an instance of a VTK object.
Represent a string by its integer hash.
record modification and/or execution time
dynamic, self-adjusting array of unsigned char