1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
// SPDX-License-Identifier: BSD-3-Clause
/**
* @class vtkEndFor
* @brief vtkEndFor define the end of the sub-pipeline to loop
*
* vtkEndFor works together with vtkForEach. It marks the end of the loop.
* Its goals is to use the given `vtkExecutionAggregator` to process the result
* of each iteration and provide an output dataset.
*
* The default aggregator is vtkAggregateToPartitionedDataSetCollection, which
* build a vtkPartitionedDataSetCollection with each result in a separate partition.
*
* > Largely inspired by the ttkForEach/ttkEndFor in the TTK project
* > (https://github.com/topology-tool-kit/ttk/tree/dev)
*
* @sa vtkForEach, vtkExecutionAggregator
*/
#ifndef vtkEndFor_h
#define vtkEndFor_h
#include "vtkCommonExecutionModelModule.h" // for export macro
#include "vtkDataObjectAlgorithm.h"
#include <memory> // for std::unique_ptr
VTK_ABI_NAMESPACE_BEGIN
class vtkExecutionAggregator;
class VTKCOMMONEXECUTIONMODEL_EXPORT vtkEndFor : public vtkDataObjectAlgorithm
{
public:
static vtkEndFor* New();
vtkTypeMacro(vtkEndFor, vtkDataObjectAlgorithm);
void PrintSelf(std::ostream& os, vtkIndent indent) override;
/**
* Aggregator object to use to reduce / aggregate results of for loop
*/
virtual void SetAggregator(vtkExecutionAggregator*);
protected:
vtkEndFor();
~vtkEndFor() override;
int RequestDataObject(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
int RequestInformation(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
private:
vtkEndFor(const vtkEndFor&) = delete;
void operator=(const vtkEndFor&) = delete;
struct Internals;
std::unique_ptr<Internals> Internal;
};
VTK_ABI_NAMESPACE_END
#endif // vtkEndFor_h
|