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 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
|
// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
// SPDX-License-Identifier: BSD-3-Clause
/**
* @class vtkEnsembleSource
* @brief source that manages dataset ensembles
*
* vtkEnsembleSource manages a collection of data sources in order to
* represent a dataset ensemble. It has the ability to provide meta-data
* about the ensemble in the form of a table, using the META_DATA key
* as well as accept a pipeline request using the UPDATE_MEMBER key.
* Note that it is expected that all ensemble members produce data of the
* same type.
*/
#ifndef vtkEnsembleSource_h
#define vtkEnsembleSource_h
#include "vtkAlgorithm.h"
#include "vtkCommonExecutionModelModule.h" // For export macro
VTK_ABI_NAMESPACE_BEGIN
struct vtkEnsembleSourceInternal;
class vtkTable;
class vtkInformationDataObjectMetaDataKey;
class vtkInformationIntegerRequestKey;
class vtkInformationIntegerKey;
class VTKCOMMONEXECUTIONMODEL_EXPORT vtkEnsembleSource : public vtkAlgorithm
{
public:
static vtkEnsembleSource* New();
vtkTypeMacro(vtkEnsembleSource, vtkAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent) override;
/**
* Add an algorithm (source) that will produce the next ensemble member.
* This algorithm will be passed the REQUEST_INFORMATION, REQUEST_UPDATE_EXTENT
* and REQUEST_DATA pipeline passes for execution.
*/
void AddMember(vtkAlgorithm*);
/**
* Removes all ensemble members.
*/
void RemoveAllMembers();
/**
* Returns the number of ensemble members.
*/
unsigned int GetNumberOfMembers();
///@{
/**
* Set/Get the current ensemble member to process. Note that this data member
* will not be used if the UPDATE_MEMBER key is present in the pipeline. Also,
* this data member may be removed in the future. Unless it is absolutely necessary
* to use this data member, use the UPDATE_MEMBER key instead.
*/
vtkSetMacro(CurrentMember, unsigned int);
vtkGetMacro(CurrentMember, unsigned int);
///@}
/**
* Set the meta-data that will be propagated downstream. Make sure that this table
* has as many rows as the ensemble members and the meta-data for each row matches
* the corresponding ensemble source.
*/
void SetMetaData(vtkTable*);
/**
* Meta-data for the ensemble. This is set with SetMetaData.
*/
static vtkInformationDataObjectMetaDataKey* META_DATA();
/**
* Key used to request a particular ensemble member.
*/
static vtkInformationIntegerRequestKey* UPDATE_MEMBER();
protected:
vtkEnsembleSource();
~vtkEnsembleSource() override;
static vtkInformationIntegerKey* DATA_MEMBER();
friend class vtkInformationEnsembleMemberRequestKey;
vtkTypeBool ProcessRequest(vtkInformation* request, vtkInformationVector** inputVector,
vtkInformationVector* outputVector) override;
int FillOutputPortInformation(int, vtkInformation*) override;
vtkAlgorithm* GetCurrentReader(vtkInformation*);
vtkEnsembleSourceInternal* Internal;
unsigned int CurrentMember;
vtkTable* MetaData;
private:
vtkEnsembleSource(const vtkEnsembleSource&) = delete;
void operator=(const vtkEnsembleSource&) = delete;
};
VTK_ABI_NAMESPACE_END
#endif
|