VTK  9.3.20240421
vtkNativePartitioningStrategy.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
27#ifndef vtkNativePartitioningStrategy_h
28#define vtkNativePartitioningStrategy_h
29
32
33VTK_ABI_NAMESPACE_BEGIN
34class vtkBoundingBox;
36class VTKFILTERSPARALLELDIY2_EXPORT vtkNativePartitioningStrategy final
38{
39public:
42 void PrintSelf(std::ostream& os, vtkIndent indent) override;
43
47 std::vector<PartitionInformation> ComputePartition(vtkPartitionedDataSetCollection*) override;
48
50
55 vtkSetMacro(UseExplicitCuts, bool);
56 vtkGetMacro(UseExplicitCuts, bool);
57 vtkBooleanMacro(UseExplicitCuts, bool);
59
61
64 void SetExplicitCuts(const std::vector<vtkBoundingBox>& boxes);
65 const std::vector<vtkBoundingBox>& GetExplicitCuts() const { return this->ExplicitCuts; }
67 void AddExplicitCut(const vtkBoundingBox& bbox);
68 void AddExplicitCut(const double bbox[6]);
70 const vtkBoundingBox& GetExplicitCut(int index) const;
72
74
84 vtkSetMacro(ExpandExplicitCuts, bool);
85 vtkGetMacro(ExpandExplicitCuts, bool);
86 vtkBooleanMacro(ExpandExplicitCuts, bool);
88
95 std::vector<vtkBoundingBox> ExpandCuts(
96 const std::vector<vtkBoundingBox>& cuts, const vtkBoundingBox& bounds);
97
99
103 const std::vector<vtkBoundingBox>& GetCuts() const { return this->Cuts; }
105
107
115 vtkSetMacro(LoadBalanceAcrossAllBlocks, bool);
116 vtkGetMacro(LoadBalanceAcrossAllBlocks, bool);
117 vtkBooleanMacro(LoadBalanceAcrossAllBlocks, bool);
119
129 virtual std::vector<vtkBoundingBox> GenerateCuts(vtkDataObject* data);
130
131protected:
133 ~vtkNativePartitioningStrategy() override = default;
134
135private:
137 void operator=(const vtkNativePartitioningStrategy&) = delete;
138
139 bool InitializeCuts(vtkDataObjectTree* input);
140
141 std::vector<vtkBoundingBox> ExplicitCuts;
142 std::vector<vtkBoundingBox> Cuts;
143 bool UseExplicitCuts = false;
144 bool ExpandExplicitCuts = true;
145
146 bool LoadBalanceAcrossAllBlocks = true;
147};
148VTK_ABI_NAMESPACE_END
149
150#endif // vtkNativePartitioningStrategy_h
Fast, simple class for representing and operating on 3D bounds.
provides implementation for most abstract methods in the superclass vtkCompositeDataSet
general representation of visualization data
a simple class to control print indentation
Definition vtkIndent.h:108
A partitioning strategy based on load balancing geometric bounding boxes as cuts of a data set.
const std::vector< vtkBoundingBox > & GetExplicitCuts() const
Specify the cuts to use when UseExplicitCuts is true.
virtual std::vector< vtkBoundingBox > GenerateCuts(vtkDataObject *data)
This method is called to generate the partitions for the input dataset.
void RemoveAllExplicitCuts()
Specify the cuts to use when UseExplicitCuts is true.
static vtkNativePartitioningStrategy * New()
std::vector< PartitionInformation > ComputePartition(vtkPartitionedDataSetCollection *) override
Implementation of parent API.
void AddExplicitCut(const double bbox[6])
Specify the cuts to use when UseExplicitCuts is true.
~vtkNativePartitioningStrategy() override=default
std::vector< vtkBoundingBox > ExpandCuts(const std::vector< vtkBoundingBox > &cuts, const vtkBoundingBox &bounds)
Helper function to expand a collection of bounding boxes to include the bounds specified.
void AddExplicitCut(const vtkBoundingBox &bbox)
Specify the cuts to use when UseExplicitCuts is true.
const vtkBoundingBox & GetExplicitCut(int index) const
Specify the cuts to use when UseExplicitCuts is true.
int GetNumberOfExplicitCuts() const
Specify the cuts to use when UseExplicitCuts is true.
const std::vector< vtkBoundingBox > & GetCuts() const
Returns the cuts used by the most recent ComputePartition call.
void PrintSelf(std::ostream &os, vtkIndent indent) override
void SetExplicitCuts(const std::vector< vtkBoundingBox > &boxes)
Specify the cuts to use when UseExplicitCuts is true.
Composite dataset that groups datasets as a collection.
A strategy interface for partitioning meshes.