VTK  9.7.1
vtkCellGridSummaryInformationQuery.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
28 #ifndef vtkCellGridSummaryInformationQuery_h
29 #define vtkCellGridSummaryInformationQuery_h
30 
31 #include "vtkCellGridQuery.h"
32 #include "vtkCommonDataModelModule.h" // for export macro
33 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
34 
35 #include <array> // For std::array
36 #include <limits> // For std::numeric_limits
37 #include <unordered_map> // For std::unordered_map
38 
39 VTK_ABI_NAMESPACE_BEGIN
40 class vtkCellAttribute;
41 
42 class VTKCOMMONDATAMODEL_EXPORT VTK_MARSHALAUTO vtkCellGridSummaryInformationQuery
43  : public vtkCellGridQuery
44 {
45 public:
48  void PrintSelf(ostream& os, vtkIndent indent) override;
49 
51  bool Initialize() override;
52 
54 
59  vtkSetStringMacro(AttributeName)
60  vtkGetStringMacro(AttributeName)
62 
65  {
69  std::array<int, 2> OrderRange{ std::numeric_limits<int>::max(),
70  std::numeric_limits<int>::min() };
71 
76  vtkIdType DOFCount{ 0 };
77  };
78 
80  const std::unordered_map<vtkCellAttribute*, SummaryInformation>& GetSummaryInformationMap() const
81  {
82  return this->SummaryInformationMap;
83  }
84 
86  const SummaryInformation& GetSummaryInformation(vtkCellAttribute* att) const;
87 
89  void AddSummaryInformation(vtkCellAttribute* att, const SummaryInformation& summaryInformation);
90 
91  // -----------------------------------------------------------------------
92  // Polynomial order range
93  // -----------------------------------------------------------------------
94 
98  void GetOrderRange(vtkCellAttribute*, int* range) const VTK_SIZEHINT(2);
99  const std::array<int, 2>& GetOrderRange(vtkCellAttribute*) const;
100 
101  // -----------------------------------------------------------------------
102  // Degrees of freedom
103  // -----------------------------------------------------------------------
104 
106  vtkIdType GetNumberOfDOF(vtkCellAttribute* att) const;
107 
108 protected:
111 
112 private:
114  void operator=(const vtkCellGridSummaryInformationQuery&) = delete;
115 
116  std::unordered_map<vtkCellAttribute*, SummaryInformation> SummaryInformationMap;
117 
118  char* AttributeName = nullptr;
119 };
120 
121 VTK_ABI_NAMESPACE_END
122 #endif // vtkCellGridSummaryInformationQuery_h
Perform an operation on cells in a vtkCellMetadata instance.
Compute summary information for a vtkCellGrid in a single pass.
const std::unordered_map< vtkCellAttribute *, SummaryInformation > & GetSummaryInformationMap() const
Return the full per-attribute DOF count map.
int vtkIdType
Definition: vtkType.h:363
Information to collect on a per-vtkCellAttribute basis.
a simple class to control print indentation
Definition: vtkIndent.h:28
A function defined over the physical domain of a vtkCellGrid.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
virtual bool Initialize()
Override this if your query-result state requires initialization.
#define max(a, b)