VTK  9.6.20260612
vtkExplodeDataSet.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
35
36#ifndef vtkExplodeDataSet_h
37#define vtkExplodeDataSet_h
38
39#include "vtkFiltersGeneralModule.h" // For export macro
41
42#include <map> // for std::map
43
44VTK_ABI_NAMESPACE_BEGIN
45class vtkDataArray;
46class vtkDataSet;
47class vtkIdList;
48class vtkPointSet;
49class vtkStringArray;
50
51class VTKFILTERSGENERAL_EXPORT vtkExplodeDataSet : public vtkPartitionedDataSetCollectionAlgorithm
52{
53public:
56 void PrintSelf(ostream& os, vtkIndent indent) override;
57
59
68 vtkSetMacro(UsePartitionNamesFromFieldData, bool);
69 vtkGetMacro(UsePartitionNamesFromFieldData, bool);
70 vtkBooleanMacro(UsePartitionNamesFromFieldData, bool);
72
74
82 vtkSetMacro(PartitionNamesArray, std::string);
83 vtkGetMacro(PartitionNamesArray, std::string);
85
87
96 vtkSetMacro(PartitionValuesArray, std::string);
97 vtkGetMacro(PartitionValuesArray, std::string);
99
100protected:
102 ~vtkExplodeDataSet() override = default;
103
105
109 int FillInputPortInformation(int port, vtkInformation* info) override;
110
111private:
112 vtkExplodeDataSet(const vtkExplodeDataSet&) = delete;
113 void operator=(const vtkExplodeDataSet&) = delete;
114
119 std::map<double, vtkSmartPointer<vtkIdList>> GetIdListsByValue(vtkDataArray* scalars);
120
126 vtkPointSet* CreatePartition(vtkDataSet* input, vtkIdList* partCellIds);
127
133 std::string GetPartitionName(vtkIdType id, const std::map<double, std::string>& providedNames,
134 double value, std::string basename);
135
142 std::map<double, std::string> GetProvidedNames(vtkDataSet* input);
143
150 vtkStringArray* GetNamesArray(vtkDataSet* input);
151
158 vtkSmartPointer<vtkDataArray> GetValuesArray(vtkDataSet* input, vtkIdType expectedSize);
159
160 bool UsePartitionNamesFromFieldData = false;
161 std::string PartitionNamesArray;
162 std::string PartitionValuesArray;
163};
164
165VTK_ABI_NAMESPACE_END
166#endif
abstract class to specify dataset behavior
Definition vtkDataSet.h:166
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Methods for subclasses to override to handle different pipeline requests.
~vtkExplodeDataSet() override=default
static vtkExplodeDataSet * New()
int FillInputPortInformation(int port, vtkInformation *info) override
Accepts vtkDataSet as input.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
list of point or cell ids
Definition vtkIdList.h:135
a simple class to control print indentation
Definition vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
concrete class for storing a set of points
Definition vtkPointSet.h:98
Hold a reference to a vtkObjectBase instance.
a vtkAbstractArray subclass for strings
#define vtkDataArray
int vtkIdType
Definition vtkType.h:363