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 
303 protected:
305  ~vtkSMSourceProxy() override;
306 
307  friend class vtkSMInputProperty;
308  friend class vtkSMOutputPort;
309 
314  void ExecuteStream(const vtkClientServerStream& msg, bool ignoreErrors = false,
315  vtkTypeUInt32 location = 0) override;
316 
318 
321 
325  virtual void InvalidateDataInformation();
326 
331  void CreateVTKObjects() override;
332 
334  vtkSetStringMacro(ExecutiveName);
335 
339  int ReadXMLAttributes(vtkSMSessionProxyManager* pm, vtkPVXMLElement* element) override;
340 
342 
347  void SetOutputPort(
348  unsigned int index, const char* name, vtkSMOutputPort* port, vtkSMDocumentation* doc);
349  void RemoveAllOutputPorts();
350  void SetExtractSelectionProxy(unsigned int index, vtkSMSourceProxy* proxy);
351  void RemoveAllExtractSelectionProxies();
353 
357  void PostUpdateData(bool) override;
358 
362  void SetLogNameInternal(
363  const char* name, bool propagate_to_subproxies, bool propagate_to_proxylistdomains) override;
364 
365  // flag used to avoid creation of extract selection proxies for this source
366  // proxy.
369 
370 private:
371  vtkSMSourceProxyInternals* PInternals;
372 
373  // used by GetNumberOfAlgorithmOutputPorts to cache the value to avoid
374  // unnecessary information gathers.
375  unsigned int NumberOfAlgorithmOutputPorts;
376  unsigned int NumberOfAlgorithmRequiredInputPorts;
377 
378  vtkSMSourceProxy(const vtkSMSourceProxy&) = delete;
379  void operator=(const vtkSMSourceProxy&) = delete;
380 
381  bool StreamReply = true;
382 };
383 
384 #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
#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