vtkSMSourceProxy.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
31 #ifndef vtkSMSourceProxy_h
32 #define vtkSMSourceProxy_h
33 
34 #include "vtkRemotingServerManagerModule.h" //needed for exports
35 #include "vtkSMProxy.h"
36 
40 
41 struct vtkSMSourceProxyInternals;
42 
43 class vtkSMOutputPort;
44 class vtkSMProperty;
46 
48 {
49 public:
50  static vtkSMSourceProxy* New();
51  vtkTypeMacro(vtkSMSourceProxy, vtkSMProxy);
52  void PrintSelf(ostream& os, vtkIndent indent) override;
53 
57  void UpdatePipelineInformation() override;
58 
63  virtual void UpdatePipeline();
64 
69  virtual void UpdatePipeline(double time);
70 
72 
75  vtkGetMacro(OutputPortsCreated, int);
77 
81  virtual unsigned int GetNumberOfOutputPorts();
82 
86  virtual vtkSMOutputPort* GetOutputPort(unsigned int idx);
87 
94  virtual vtkSMOutputPort* GetOutputPort(const char* portname);
95 
104  virtual unsigned int GetOutputPortIndex(const char* portname);
105 
112  virtual const char* GetOutputPortName(unsigned int index);
113 
115 
121  vtkSMDocumentation* GetOutputPortDocumentation(unsigned int index);
122  vtkSMDocumentation* GetOutputPortDocumentation(const char* portname);
124 
130  virtual void CreateOutputPorts();
131 
133 
140  vtkPVDataInformation* GetDataInformation(unsigned int outputIdx);
142 
151  vtkPVDataInformation* GetDataSetInformation(unsigned int outputIdx);
152 
154 
167  vtkPVDataInformation* GetSubsetDataInformation(
168  unsigned int outputIdx, const char* selector, const char* assemblyName = nullptr);
170 
175  vtkPVDataInformation* GetSubsetDataInformation(
176  unsigned int outputIdx, unsigned int compositeIndex);
177 
179 
183  {
184  return this->GetRankDataInformation(0u, rank);
185  }
186  vtkPVDataInformation* GetRankDataInformation(unsigned int outputIdx, int rank);
188 
193  virtual void CreateSelectionProxies();
194 
200  void SetSelectionInput(unsigned int portIndex, vtkSMSourceProxy* input, unsigned int outputPort);
201 
203 
206  vtkSMSourceProxy* GetSelectionInput(unsigned int portIndex);
207  unsigned int GetSelectionInputPort(unsigned int portIndex);
209 
213  void CleanSelectionInputs(unsigned int portIndex);
214 
219  vtkSMSourceProxy* GetSelectionOutput(unsigned int portIndex);
220 
221  using Superclass::SaveXMLState;
223 
227  int LoadXMLState(vtkPVXMLElement* element, vtkSMProxyLocator* locator) override;
229 
239  vtkGetMacro(ProcessSupport, int);
240 
246  vtkGetMacro(MPIRequired, bool);
247 
253  vtkGetMacro(StreamReply, bool);
254 
258  unsigned int GetNumberOfAlgorithmOutputPorts();
259 
264  virtual unsigned int GetNumberOfAlgorithmRequiredInputPorts();
265 
269  vtkTypeUInt32 GetGlobalID() override;
270 
272 
275  unsigned int GetSelectionId();
276  unsigned int GetSelectionPort();
277  void SetSelectionId(unsigned int id);
278  void SetSelectionPort(unsigned int port);
280 
282  {
285  BOTH
286  };
287 
291  void MarkDirty(vtkSMProxy* modifiedProxy) override;
292 
296  void EnableAbortCheck();
297 
301  void ClearAbortFlags();
302 
307  void RecreateVTKObjects() override;
308 
309 protected:
311  ~vtkSMSourceProxy() override;
312 
313  friend class vtkSMInputProperty;
314  friend class vtkSMOutputPort;
315 
320  void ExecuteStream(const vtkClientServerStream& msg, bool ignoreErrors = false,
321  vtkTypeUInt32 location = 0) override;
322 
324 
327 
331  virtual void InvalidateDataInformation();
332 
337  void CreateVTKObjects() override;
338 
340  vtkSetStringMacro(ExecutiveName);
341 
345  int ReadXMLAttributes(vtkSMSessionProxyManager* pm, vtkPVXMLElement* element) override;
346 
348 
353  void SetOutputPort(
354  unsigned int index, const char* name, vtkSMOutputPort* port, vtkSMDocumentation* doc);
355  void RemoveAllOutputPorts();
356  void SetExtractSelectionProxy(unsigned int index, vtkSMSourceProxy* proxy);
357  void RemoveAllExtractSelectionProxies();
359 
363  void PostUpdateData(bool) override;
364 
368  void SetLogNameInternal(
369  const char* name, bool propagate_to_subproxies, bool propagate_to_proxylistdomains) override;
370 
371  // flag used to avoid creation of extract selection proxies for this source
372  // proxy.
375 
376 private:
377  vtkSMSourceProxyInternals* PInternals;
378 
379  // used by GetNumberOfAlgorithmOutputPorts to cache the value to avoid
380  // unnecessary information gathers.
381  unsigned int NumberOfAlgorithmOutputPorts;
382  unsigned int NumberOfAlgorithmRequiredInputPorts;
383 
384  vtkSMSourceProxy(const vtkSMSourceProxy&) = delete;
385  void operator=(const vtkSMSourceProxy&) = delete;
386 
387  bool StreamReply = true;
388 };
389 
390 #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:703
provides meta data about a vtkDataObject subclass.
void PrintSelf(ostream &os, vtkIndent indent) override
virtual void RecreateVTKObjects()
Recreate the VTK object for this proxy.
#define VTKREMOTINGSERVERMANAGER_EXPORT
virtual int ReadXMLAttributes(vtkSMSessionProxyManager *pm, vtkPVXMLElement *element)
Read attributes from an XML element.
superclass for all SM properties
virtual void ExecuteStream(const vtkClientServerStream &msg, bool ignore_errors=false, vtkTypeUInt32 location=0)
Invoke that takes a vtkClientServerStream as the argument.
virtual void InvalidateDataInformation()
Mark data information as invalid.
Store messages for the interpreter.
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