VTK  9.3.20240918
vtkCellAttributeCalculator.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
21#ifndef vtkCellAttributeCalculator_h
22#define vtkCellAttributeCalculator_h
23
24#include "vtkCommonDataModelModule.h" // for export
25#include "vtkObject.h"
26#include "vtkSmartPointer.h" // for API.
27
28#include <unordered_map>
29
30VTK_ABI_NAMESPACE_BEGIN
31class vtkCellGrid;
32class vtkCellMetadata;
34
35class VTKCOMMONDATAMODEL_EXPORT vtkCellAttributeCalculator : public vtkObject
36{
37public:
40 void PrintSelf(ostream& os, vtkIndent indent) override;
41
43 template <typename CalculatorType>
45 {
46 auto result = this->PrepareForGrid(cell, field);
47 return CalculatorType::SafeDownCast(result);
48 }
49
53 vtkCellMetadata* vtkNotUsed(cell), vtkCellAttribute* vtkNotUsed(field))
54 {
55 return nullptr;
56 }
57
58protected:
60 ~vtkCellAttributeCalculator() override = default;
61
62private:
64 void operator=(const vtkCellAttributeCalculator&) = delete;
65};
66
67VTK_ABI_NAMESPACE_END
68#endif
Perform a per-cell calculation on a vtkCellAttribute.
static vtkCellAttributeCalculator * New()
vtkSmartPointer< CalculatorType > Prepare(vtkCellMetadata *cell, vtkCellAttribute *field)
Return an instance of a calculator ready to work on cell and field.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
~vtkCellAttributeCalculator() override=default
vtkCellAttributeCalculator()=default
virtual vtkSmartPointer< vtkCellAttributeCalculator > PrepareForGrid(vtkCellMetadata *vtkNotUsed(cell), vtkCellAttribute *vtkNotUsed(field))
Subclasses should override this to create an instance of their class with member variables set to per...
A function defined over the physical domain of a vtkCellGrid.
Visualization data composed of cells of arbitrary type.
Definition vtkCellGrid.h:46
Metadata for a particular type of cell (finite element).
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
Hold a reference to a vtkObjectBase instance.