VTK  9.7.1
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
36 #ifndef vtkExplodeDataSet_h
37 #define vtkExplodeDataSet_h
38 
39 #include "vtkFiltersGeneralModule.h" // For export macro
41 
42 #include <map> // for std::map
43 
44 VTK_ABI_NAMESPACE_BEGIN
45 class vtkDataArray;
46 class vtkDataSet;
47 class vtkIdList;
48 class vtkPointSet;
49 class vtkStringArray;
50 
51 class VTKFILTERSGENERAL_EXPORT vtkExplodeDataSet : public vtkPartitionedDataSetCollectionAlgorithm
52 {
53 public:
54  static vtkExplodeDataSet* New();
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 
100 protected:
102  ~vtkExplodeDataSet() override = default;
103 
105 
109  int FillInputPortInformation(int port, vtkInformation* info) override;
110 
111 private:
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 
165 VTK_ABI_NAMESPACE_END
166 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Methods for subclasses to override to handle different pipeline requests.
a vtkAbstractArray subclass for strings
concrete class for storing a set of points
Definition: vtkPointSet.h:58
int vtkIdType
Definition: vtkType.h:363
Explode input dataset according to a cell scalar isovalue criteria.
a simple class to control print indentation
Definition: vtkIndent.h:28
list of point or cell ids
Definition: vtkIdList.h:25
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
Superclass for algorithms that produce vtkPartitionedDataSetCollectionAlgorithm.
Store zero or more vtkInformation instances.
static vtkAlgorithm * New()