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 
37 class VTKREMOTINGSERVERMANAGER_EXPORT vtkSMSourceProxy : public vtkSMProxy
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
vtkSMSessionProxyManager
Definition: vtkSMSessionProxyManager.h:135
vtkSMProxy::New
static vtkSMProxy * New()
vtkSMProxy::CreateVTKObjects
virtual void CreateVTKObjects()
Given a class name (by setting VTKClassName) and server ids (by setting ServerIDs),...
vtkSMSourceProxy::ProcessSupportType
ProcessSupportType
Definition: vtkSMSourceProxy.h:239
vtkSMSourceProxy::MULTIPLE_PROCESSES
@ MULTIPLE_PROCESSES
Definition: vtkSMSourceProxy.h:242
vtkSMProxy::MarkDirty
virtual void MarkDirty(vtkSMProxy *modifiedProxy)
Dirty means this algorithm will execute during next update.
vtkSMSourceProxy::MPIRequired
bool MPIRequired
Definition: vtkSMSourceProxy.h:261
vtkSMSourceProxy::SINGLE_PROCESS
@ SINGLE_PROCESS
Definition: vtkSMSourceProxy.h:241
vtkSMProxy::PostUpdateData
virtual void PostUpdateData(bool using_cache)
This method is called after the algorithm(s) (if any) associated with this proxy execute.
vtkSMSourceProxy::ExecutiveName
char * ExecutiveName
Definition: vtkSMSourceProxy.h:274
vtkSMProperty
superclass for all SM properties
Definition: vtkSMProperty.h:144
vtkPVDataSetAttributesInformation
List of array info.
Definition: vtkPVDataSetAttributesInformation.h:24
vtkSMProxy
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
vtkSMProxy::ReadXMLAttributes
virtual int ReadXMLAttributes(vtkSMSessionProxyManager *pm, vtkPVXMLElement *element)
Read attributes from an XML element.
vtkSMSourceProxy
proxy for a VTK source on a server
Definition: vtkSMSourceProxy.h:37
vtkSMProxy::vtkSMSourceProxy
friend class vtkSMSourceProxy
These classes have been declared as friends to minimize the public interface exposed by vtkSMProxy.
Definition: vtkSMProxy.h:688
vtkSMDocumentation
class providing access to the documentation for a vtkSMProxy.
Definition: vtkSMDocumentation.h:21
vtkSMSourceProxy::OutputPortsCreated
int OutputPortsCreated
Definition: vtkSMSourceProxy.h:258
vtkSMSourceProxy::DisableSelectionProxies
bool DisableSelectionProxies
Definition: vtkSMSourceProxy.h:308
vtkSMOutputPort::InvalidateDataInformation
virtual void InvalidateDataInformation()
Mark data information as invalid.
vtkSMProxy::operator=
void operator=(const vtkSMProxy &)=delete
vtkIndent
vtkPVDataInformation
provides meta data about a vtkDataObject subclass.
Definition: vtkPVDataInformation.h:42
vtkPVXMLElement
Definition: vtkPVXMLElement.h:23
vtkPVArrayInformation
provides meta data about arrays.
Definition: vtkPVArrayInformation.h:30
vtkSMProxy.h
vtkSMRemoteObject::GetGlobalID
virtual vtkTypeUInt32 GetGlobalID()
Get the global unique id for this object.
vtkSMSourceProxy::GetRankDataInformation
vtkPVDataInformation * GetRankDataInformation(int rank)
Get rank-specific data information.
Definition: vtkSMSourceProxy.h:162
vtkSMProxy::UpdatePipelineInformation
virtual void UpdatePipelineInformation()
This method simply iterates over subproxies and calls UpdatePipelineInformation() on them.
vtkSMSourceProxy::SelectionProxiesCreated
bool SelectionProxiesCreated
Definition: vtkSMSourceProxy.h:309
vtkSMProxy::SetLogNameInternal
virtual void SetLogNameInternal(const char *name, bool propagate_to_subproxies, bool propagate_to_proxylistdomains)
Internal method used by SetLogName
vtkSMSourceProxy::ProcessSupport
int ProcessSupport
Definition: vtkSMSourceProxy.h:260
vtkSMProxy::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
vtkSMOutputPort
reference for an output port of a vtkAlgorithm.
Definition: vtkSMOutputPort.h:36
vtkSMSourceProxy::GetDataInformation
vtkPVDataInformation * GetDataInformation()
DataInformation is used by the source proxy to obtain information on the output(s) from the server.
Definition: vtkSMSourceProxy.h:129
vtkSMInputProperty
proxy representing inputs to a filter
Definition: vtkSMInputProperty.h:28