vtkPVDataMover.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkPVDataMover.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
24 #ifndef vtkPVDataMover_h
25 #define vtkPVDataMover_h
26 
27 #include "vtkObject.h"
28 #include "vtkRemotingServerManagerModule.h" // for exports
29 
30 #include <map> // for std::map
31 #include <vector> // for std::vector
32 
33 class vtkAlgorithm;
34 class vtkDataObject;
35 
37 {
38 public:
39  static vtkPVDataMover* New();
40  vtkTypeMacro(vtkPVDataMover, vtkObject);
41  void PrintSelf(ostream& os, vtkIndent indent) override;
42 
44 
47  void SetProducer(vtkAlgorithm* producer);
48  vtkGetObjectMacro(Producer, vtkAlgorithm);
50 
52 
55  vtkSetClampMacro(PortNumber, int, 0, VTK_INT_MAX);
56  vtkGetMacro(PortNumber, int);
58 
60 
67  vtkSetMacro(GatherOnAllRanks, bool);
68  vtkGetMacro(GatherOnAllRanks, bool);
70 
72 
77  vtkSetMacro(SkipEmptyDataSets, bool);
78  vtkGetMacro(SkipEmptyDataSets, bool);
79  vtkBooleanMacro(SkipEmptyDataSets, bool);
81 
83 
85 
90  void AddSourceRank(int rank);
91  void ClearAllSourceRanks();
92  void SetSourceRanks(const std::vector<int>& ranks);
93  const std::vector<int>& GetSourceRanks() const { return this->SourceRanks; }
95 
99  bool Execute();
100 
102 
104  unsigned int GetNumberOfDataSets() const;
105  int GetDataSetRank(unsigned int index) const;
106  vtkDataObject* GetDataSetAtIndex(unsigned int index) const;
107  vtkDataObject* GetDataSetFromRank(int rank) const;
109 protected:
110  vtkPVDataMover();
111  ~vtkPVDataMover() override;
112 
113 private:
114  vtkPVDataMover(const vtkPVDataMover&) = delete;
115  void operator=(const vtkPVDataMover&) = delete;
116 
117  vtkAlgorithm* Producer = nullptr;
118  int PortNumber = 0;
119  bool GatherOnAllRanks = false;
120  bool SkipEmptyDataSets = false;
121 
122  std::vector<int> SourceRanks;
123  std::map<int, vtkSmartPointer<vtkDataObject>> DataSets;
124 };
125 
126 #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 &)