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 
141  vtkPVDataInformation* GetDataSetInformation(unsigned int outputIdx);
142 
144 
157  vtkPVDataInformation* GetSubsetDataInformation(
158  unsigned int outputIdx, const char* selector, const char* assemblyName = nullptr);
160 
165  vtkPVDataInformation* GetSubsetDataInformation(
166  unsigned int outputIdx, unsigned int compositeIndex);
167 
169 
173  {
174  return this->GetRankDataInformation(0u, rank);
175  }
176  vtkPVDataInformation* GetRankDataInformation(unsigned int outputIdx, int rank);
178 
183  virtual void CreateSelectionProxies();
184 
190  void SetSelectionInput(unsigned int portIndex, vtkSMSourceProxy* input, unsigned int outputPort);
191 
193 
196  vtkSMSourceProxy* GetSelectionInput(unsigned int portIndex);
197  unsigned int GetSelectionInputPort(unsigned int portIndex);
199 
203  void CleanSelectionInputs(unsigned int portIndex);
204 
209  vtkSMSourceProxy* GetSelectionOutput(unsigned int portIndex);
210 
211  using Superclass::SaveXMLState;
213 
217  int LoadXMLState(vtkPVXMLElement* element, vtkSMProxyLocator* locator) override;
219 
221 
230  vtkGetMacro(ProcessSupport, int);
232 
234 
239  vtkGetMacro(MPIRequired, bool);
241 
245  unsigned int GetNumberOfAlgorithmOutputPorts();
246 
251  virtual unsigned int GetNumberOfAlgorithmRequiredInputPorts();
252 
256  vtkTypeUInt32 GetGlobalID() override;
257 
259 
262  unsigned int GetSelectionId();
263  unsigned int GetSelectionPort();
264  void SetSelectionId(unsigned int id);
265  void SetSelectionPort(unsigned int port);
267 
269  {
272  BOTH
273  };
274 
278  void MarkDirty(vtkSMProxy* modifiedProxy) override;
279 
280 protected:
282  ~vtkSMSourceProxy() override;
283 
284  friend class vtkSMInputProperty;
285  friend class vtkSMOutputPort;
286 
288 
291 
295  virtual void InvalidateDataInformation();
296 
301  void CreateVTKObjects() override;
302 
304  vtkSetStringMacro(ExecutiveName);
305 
309  int ReadXMLAttributes(vtkSMSessionProxyManager* pm, vtkPVXMLElement* element) override;
310 
312 
317  void SetOutputPort(
318  unsigned int index, const char* name, vtkSMOutputPort* port, vtkSMDocumentation* doc);
319  void RemoveAllOutputPorts();
320  void SetExtractSelectionProxy(unsigned int index, vtkSMSourceProxy* proxy);
321  void RemoveAllExtractSelectionProxies();
323 
327  void PostUpdateData(bool) override;
328 
332  void SetLogNameInternal(
333  const char* name, bool propagate_to_subproxies, bool propagate_to_proxylistdomains) override;
334 
335  // flag used to avoid creation of extract selection proxies for this source
336  // proxy.
339 
340 private:
341  vtkSMSourceProxyInternals* PInternals;
342 
343  // used by GetNumberOfAlgorithmOutputPorts to cache the value to avoid
344  // unnecessary information gathers.
345  unsigned int NumberOfAlgorithmOutputPorts;
346  unsigned int NumberOfAlgorithmRequiredInputPorts;
347 
348  vtkSMSourceProxy(const vtkSMSourceProxy&) = delete;
349  void operator=(const vtkSMSourceProxy&) = delete;
350 };
351 
352 #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:698
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)
virtual int LoadXMLState(vtkPVXMLElement *element, vtkSMProxyLocator *locator)
Loads the proxy state from the XML element.
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
is used to locate proxies referred to in state xmls while loading state files.
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
virtual vtkPVXMLElement * SaveXMLState(vtkPVXMLElement *root)
Saves the state of the proxy.
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
port
virtual vtkTypeUInt32 GetGlobalID()
Get the global unique id for this object.
iterates over the properties of a proxy
proxy representing inputs to a filter