vtkExtractsDeliveryHelper.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
9 #ifndef vtkExtractsDeliveryHelper_h
10 #define vtkExtractsDeliveryHelper_h
11 
12 #include "vtkObject.h"
13 #include "vtkRemotingLiveModule.h" //needed for exports
14 #include "vtkSmartPointer.h" // needed for smart pointer
15 
16 class vtkAlgorithmOutput;
17 class vtkDataObject;
20 class vtkTrivialProducer;
21 
22 #include <map> // needed for typedef
23 #include <string> // needed for typedef
24 
26 {
27 public:
30  void PrintSelf(ostream& os, vtkIndent indent) override;
31 
32  vtkSetMacro(ProcessIsProducer, bool);
33  vtkGetMacro(ProcessIsProducer, bool);
34 
35  // Controller to used to communicate between sim and viz.
36  void SetSimulation2VisualizationController(vtkSocketController*);
37 
38  // The MPI communicator to communicate between the process in the process
39  // group. This is only used on the simulation processes.
40  void SetParallelController(vtkMultiProcessController*);
41 
42  // Reset all information about extracts.
43  void ClearAllExtracts();
44 
45  // Register extracts. This method is used on the Visualization processes to
46  // register the producer
47  void AddExtractConsumer(const char* key, vtkTrivialProducer* consumer);
48  void RemoveExtractConsumer(const char* key);
49 
50  void AddExtractProducer(const char* key, vtkAlgorithmOutput* producerPort);
51 
55  bool Update();
56 
57  vtkSetMacro(NumberOfVisualizationProcesses, int);
58  vtkGetMacro(NumberOfVisualizationProcesses, int);
59  vtkSetMacro(NumberOfSimulationProcesses, int);
60  vtkGetMacro(NumberOfSimulationProcesses, int);
61 
62 protected:
64  ~vtkExtractsDeliveryHelper() override;
65 
66  vtkDataObject* Collect(int nodes_to_collect_to, vtkDataObject*);
67 
71 
72  // the bool is to keep track of whether the trivial producer has had
73  // its output set yet. we don't want to update the pipeline until
74  // it gets its output.
75  typedef std::map<std::string, std::pair<vtkSmartPointer<vtkTrivialProducer>, bool>>
78 
79  typedef std::map<std::string, vtkSmartPointer<vtkAlgorithmOutput>> ExtractProducersType;
80  ExtractProducersType ExtractProducers;
81 
84 
85 private:
87  void operator=(const vtkExtractsDeliveryHelper&) = delete;
88 };
89 
90 #endif
vtkSmartPointer< vtkMultiProcessController > ParallelController
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
#define VTKREMOTINGLIVE_EXPORT
virtual void Update()
std::map< std::string, vtkSmartPointer< vtkAlgorithmOutput > > ExtractProducersType
vtkSmartPointer< vtkSocketController > Simulation2VisualizationController
ExtractConsumersType ExtractConsumers
std::map< std::string, std::pair< vtkSmartPointer< vtkTrivialProducer >, bool > > ExtractConsumersType
ExtractProducersType ExtractProducers
static vtkObject * New()
void operator=(const vtkObjectBase &)