vtkExtractsDeliveryHelper.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: $RCSfile$
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 =========================================================================*/
21 #ifndef vtkExtractsDeliveryHelper_h
22 #define vtkExtractsDeliveryHelper_h
23 
24 #include "vtkObject.h"
25 #include "vtkRemotingLiveModule.h" //needed for exports
26 #include "vtkSmartPointer.h" // needed for smart pointer
27 
28 class vtkAlgorithmOutput;
29 class vtkDataObject;
32 class vtkTrivialProducer;
33 
34 #include <map> // needed for typedef
35 #include <string> // needed for typedef
36 
38 {
39 public:
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
44  vtkSetMacro(ProcessIsProducer, bool);
45  vtkGetMacro(ProcessIsProducer, bool);
46 
47  // Controller to used to communicate between sim and viz.
48  void SetSimulation2VisualizationController(vtkSocketController*);
49 
50  // The MPI communicator to communicate between the process in the process
51  // group. This is only used on the simulation processes.
52  void SetParallelController(vtkMultiProcessController*);
53 
54  // Reset all information about extracts.
55  void ClearAllExtracts();
56 
57  // Register extracts. This method is used on the Visualization processes to
58  // register the producer
59  void AddExtractConsumer(const char* key, vtkTrivialProducer* consumer);
60  void RemoveExtractConsumer(const char* key);
61 
62  void AddExtractProducer(const char* key, vtkAlgorithmOutput* producerPort);
63 
67  bool Update();
68 
69  vtkSetMacro(NumberOfVisualizationProcesses, int);
70  vtkGetMacro(NumberOfVisualizationProcesses, int);
71  vtkSetMacro(NumberOfSimulationProcesses, int);
72  vtkGetMacro(NumberOfSimulationProcesses, int);
73 
74 protected:
76  ~vtkExtractsDeliveryHelper() override;
77 
78  vtkDataObject* Collect(int nodes_to_collect_to, vtkDataObject*);
79 
83 
84  // the bool is to keep track of whether the trivial producer has had
85  // its output set yet. we don't want to update the pipeline until
86  // it gets its output.
87  typedef std::map<std::string, std::pair<vtkSmartPointer<vtkTrivialProducer>, bool> >
90 
91  typedef std::map<std::string, vtkSmartPointer<vtkAlgorithmOutput> > ExtractProducersType;
92  ExtractProducersType ExtractProducers;
93 
96 
97 private:
99  void operator=(const vtkExtractsDeliveryHelper&) = delete;
100 };
101 
102 #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 &)