vtkPVDataMover.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
12 #ifndef vtkPVDataMover_h
13 #define vtkPVDataMover_h
14 
15 #include "vtkObject.h"
16 #include "vtkRemotingServerManagerModule.h" // for exports
17 
18 #include <map> // for std::map
19 #include <vector> // for std::vector
20 
21 class vtkAlgorithm;
22 class vtkDataObject;
23 
25 {
26 public:
27  static vtkPVDataMover* New();
28  vtkTypeMacro(vtkPVDataMover, vtkObject);
29  void PrintSelf(ostream& os, vtkIndent indent) override;
30 
32 
35  void SetProducer(vtkAlgorithm* producer);
36  vtkGetObjectMacro(Producer, vtkAlgorithm);
38 
40 
43  vtkSetClampMacro(PortNumber, int, 0, VTK_INT_MAX);
44  vtkGetMacro(PortNumber, int);
46 
48 
55  vtkSetMacro(GatherOnAllRanks, bool);
56  vtkGetMacro(GatherOnAllRanks, bool);
58 
60 
65  vtkSetMacro(SkipEmptyDataSets, bool);
66  vtkGetMacro(SkipEmptyDataSets, bool);
67  vtkBooleanMacro(SkipEmptyDataSets, bool);
69 
71 
73 
78  void AddSourceRank(int rank);
79  void ClearAllSourceRanks();
80  void SetSourceRanks(const std::vector<int>& ranks);
81  const std::vector<int>& GetSourceRanks() const { return this->SourceRanks; }
83 
87  bool Execute();
88 
90 
92  unsigned int GetNumberOfDataSets() const;
93  int GetDataSetRank(unsigned int index) const;
94  vtkDataObject* GetDataSetAtIndex(unsigned int index) const;
95  vtkDataObject* GetDataSetFromRank(int rank) const;
97 protected:
99  ~vtkPVDataMover() override;
100 
101 private:
102  vtkPVDataMover(const vtkPVDataMover&) = delete;
103  void operator=(const vtkPVDataMover&) = delete;
104 
105  vtkAlgorithm* Producer = nullptr;
106  int PortNumber = 0;
107  bool GatherOnAllRanks = false;
108  bool SkipEmptyDataSets = false;
109 
110  std::vector<int> SourceRanks;
111  std::map<int, vtkSmartPointer<vtkDataObject>> DataSets;
112 };
113 
114 #endif
#define VTKREMOTINGSERVERMANAGER_EXPORT
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
const std::vector< int > & GetSourceRanks() const
API to select source ranks.
static vtkObject * New()
index
helper to move data between ParaView processes.
void operator=(const vtkObjectBase &)