vtkSMSourceProxy.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
21 #ifndef vtkSMSourceProxy_h
22 #define vtkSMSourceProxy_h
23 
24 #include "vtkRemotingServerManagerModule.h" //needed for exports
25 #include "vtkSMProxy.h"
26 
30 
31 struct vtkSMSourceProxyInternals;
32 
33 class vtkSMOutputPort;
34 class vtkSMProperty;
36 
38 {
39 public:
40  static vtkSMSourceProxy* New();
41  vtkTypeMacro(vtkSMSourceProxy, vtkSMProxy);
42  void PrintSelf(ostream& os, vtkIndent indent) override;
43 
47  void UpdatePipelineInformation() override;
48 
53  virtual void UpdatePipeline();
54 
59  virtual void UpdatePipeline(double time);
60 
62 
65  vtkGetMacro(OutputPortsCreated, int);
67 
71  virtual unsigned int GetNumberOfOutputPorts();
72 
76  virtual vtkSMOutputPort* GetOutputPort(unsigned int idx);
77 
84  virtual vtkSMOutputPort* GetOutputPort(const char* portname);
85 
94  virtual unsigned int GetOutputPortIndex(const char* portname);
95 
102  virtual const char* GetOutputPortName(unsigned int index);
103 
105 
111  vtkSMDocumentation* GetOutputPortDocumentation(unsigned int index);
112  vtkSMDocumentation* GetOutputPortDocumentation(const char* portname);
114 
120  virtual void CreateOutputPorts();
121 
123 
130  vtkPVDataInformation* GetDataInformation(unsigned int outputIdx);
132 
134 
147  vtkPVDataInformation* GetSubsetDataInformation(
148  unsigned int outputIdx, const char* selector, const char* assemblyName = nullptr);
150 
155  vtkPVDataInformation* GetSubsetDataInformation(
156  unsigned int outputIdx, unsigned int compositeIndex);
157 
159 
163  {
164  return this->GetRankDataInformation(0u, rank);
165  }
166  vtkPVDataInformation* GetRankDataInformation(unsigned int outputIdx, int rank);
168 
173  virtual void CreateSelectionProxies();
174 
180  void SetSelectionInput(unsigned int portIndex, vtkSMSourceProxy* input, unsigned int outputPort);
181 
183 
186  vtkSMSourceProxy* GetSelectionInput(unsigned int portIndex);
187  unsigned int GetSelectionInputPort(unsigned int portIndex);
189 
193  void CleanSelectionInputs(unsigned int portIndex);
194 
199  vtkSMSourceProxy* GetSelectionOutput(unsigned int portIndex);
200 
202 
211  vtkGetMacro(ProcessSupport, int);
213 
215 
220  vtkGetMacro(MPIRequired, bool);
222 
226  unsigned int GetNumberOfAlgorithmOutputPorts();
227 
232  virtual unsigned int GetNumberOfAlgorithmRequiredInputPorts();
233 
237  vtkTypeUInt32 GetGlobalID() override;
238 
240  {
243  BOTH
244  };
245 
249  void MarkDirty(vtkSMProxy* modifiedProxy) override;
250 
251 protected:
253  ~vtkSMSourceProxy() override;
254 
255  friend class vtkSMInputProperty;
256  friend class vtkSMOutputPort;
257 
259 
262 
266  virtual void InvalidateDataInformation();
267 
272  void CreateVTKObjects() override;
273 
275  vtkSetStringMacro(ExecutiveName);
276 
280  int ReadXMLAttributes(vtkSMSessionProxyManager* pm, vtkPVXMLElement* element) override;
281 
283 
288  void SetOutputPort(
289  unsigned int index, const char* name, vtkSMOutputPort* port, vtkSMDocumentation* doc);
290  void RemoveAllOutputPorts();
291  void SetExtractSelectionProxy(unsigned int index, vtkSMSourceProxy* proxy);
292  void RemoveAllExtractSelectionProxies();
294 
298  void PostUpdateData(bool) override;
299 
303  void SetLogNameInternal(
304  const char* name, bool propagate_to_subproxies, bool propagate_to_proxylistdomains) override;
305 
306  // flag used to avoid creation of extract selection proxies for this source
307  // proxy.
310 
311 private:
312  vtkSMSourceProxyInternals* PInternals;
313 
314  // used by GetNumberOfAlgorithmOutputPorts to cache the value to avoid
315  // unnecessary information gathers.
316  unsigned int NumberOfAlgorithmOutputPorts;
317  unsigned int NumberOfAlgorithmRequiredInputPorts;
318 
319  vtkSMSourceProxy(const vtkSMSourceProxy&) = delete;
320  void operator=(const vtkSMSourceProxy&) = delete;
321 };
322 
323 #endif
virtual void PostUpdateData(bool using_cache)
This method is called after the algorithm(s) (if any) associated with this proxy execute.
virtual void UpdatePipelineInformation()
This method simply iterates over subproxies and calls UpdatePipelineInformation() on them...
friend class vtkSMSourceProxy
These classes have been declared as friends to minimize the public interface exposed by vtkSMProxy...
Definition: vtkSMProxy.h:688
provides meta data about a vtkDataObject subclass.
void PrintSelf(ostream &os, vtkIndent indent) override
#define VTKREMOTINGSERVERMANAGER_EXPORT
virtual int ReadXMLAttributes(vtkSMSessionProxyManager *pm, vtkPVXMLElement *element)
Read attributes from an XML element.
superclass for all SM properties
virtual void InvalidateDataInformation()
Mark data information as invalid.
virtual void MarkDirty(vtkSMProxy *modifiedProxy)
Dirty means this algorithm will execute during next update.
virtual void SetLogNameInternal(const char *name, bool propagate_to_subproxies, bool propagate_to_proxylistdomains)
Internal method used by SetLogName
vtkPVDataInformation * GetRankDataInformation(int rank)
Get rank-specific data information.
proxy for a VTK source on a server
The vtkSMSessionProxyManager is esponsible for creating and managing proxies for a given session...
vtkPVDataInformation * GetDataInformation()
DataInformation is used by the source proxy to obtain information on the output(s) from the server...
static vtkSMProxy * New()
virtual void CreateVTKObjects()
Given a class name (by setting VTKClassName) and server ids (by setting ServerIDs), this methods instantiates the objects on the server(s)
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
provides meta data about arrays.
reference for an output port of a vtkAlgorithm.
class providing access to the documentation for a vtkSMProxy.
void operator=(const vtkSMProxy &)=delete
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
virtual vtkTypeUInt32 GetGlobalID()
Get the global unique id for this object.
proxy representing inputs to a filter