vtkRemoteWriterHelper.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
22 #ifndef vtkRemoteWriterHelper_h
23 #define vtkRemoteWriterHelper_h
24 
25 #include "vtkDataObjectAlgorithm.h"
26 #include "vtkPVSession.h" // for vtkPVSession::ServerFlags
27 #include "vtkRemotingServerManagerModule.h" // for exports
28 
29 class vtkAlgorithm;
31 class vtkDataObject;
32 
34 {
35 public:
36  static vtkRemoteWriterHelper* New();
38  void PrintSelf(ostream& os, vtkIndent indent) override;
39 
41 
44  void SetWriter(vtkAlgorithm* writer);
45  vtkGetObjectMacro(Writer, vtkAlgorithm);
47 
49 
56  vtkSetMacro(OutputDestination, vtkTypeUInt32);
57  vtkGetMacro(OutputDestination, vtkTypeUInt32);
59 
61 
66  vtkSetMacro(TryWritingInBackground, bool);
67  vtkGetMacro(TryWritingInBackground, bool);
68  vtkBooleanMacro(TryWritingInBackground, bool);
70 
77  enum
78  {
79  START = 0,
80  WRITE = 1,
81  END = 2
82  };
83 
85 
93  vtkSetClampMacro(State, int, START, END);
94  vtkGetMacro(State, int);
96 
98 
103  void SetInterpreter(vtkClientServerInterpreter* interp);
104  vtkGetObjectMacro(Interpreter, vtkClientServerInterpreter);
106 
108  void operator=(const vtkRemoteWriterHelper&) = delete;
109 
118  static void Wait(const std::string& fileName);
119 
123  static void Wait();
124 
128  int Write();
129 
130 protected:
132  ~vtkRemoteWriterHelper() override;
133 
134  int RequestData(vtkInformation* request, vtkInformationVector** inputVector,
135  vtkInformationVector* outputVector) override;
136  int FillInputPortInformation(int port, vtkInformation* info) override;
137 
141  void WriteLocally(vtkDataObject* input);
142 
143  vtkTypeUInt32 OutputDestination = vtkPVSession::CLIENT;
144  int State = WRITE;
145  vtkAlgorithm* Writer = nullptr;
146  vtkClientServerInterpreter* Interpreter = nullptr;
147  bool TryWritingInBackground = false;
148 };
149 
150 #endif /* end of include guard: vtkRemoteWriterHelper_h */
#define VTKREMOTINGSERVERMANAGER_EXPORT
static vtkDataObjectAlgorithm * New()
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
Run-time VTK interpreter.
Helper to write data on client or data-server-root.
virtual int FillInputPortInformation(int port, vtkInformation *info)
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
void operator=(const vtkObjectBase &)