vtkSMLink.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
12 #ifndef vtkSMLink_h
13 #define vtkSMLink_h
14 
15 #include "vtkRemotingServerManagerModule.h" //needed for exports
16 #include "vtkSMMessageMinimal.h" // Needed
17 #include "vtkSMRemoteObject.h"
18 
19 class vtkCommand;
20 class vtkPVXMLElement;
21 class vtkSMProxy;
22 class vtkSMProxyLocator;
23 
25 {
26 public:
27  vtkTypeMacro(vtkSMLink, vtkSMRemoteObject);
28  void PrintSelf(ostream& os, vtkIndent indent) override;
29 
31  {
32  NONE = 0,
33  INPUT = 1,
34  OUTPUT = 2
35  };
36 
38 
42  vtkSetMacro(PropagateUpdateVTKObjects, int);
43  vtkGetMacro(PropagateUpdateVTKObjects, int);
44  vtkBooleanMacro(PropagateUpdateVTKObjects, int);
46 
48 
52  vtkSetMacro(Enabled, bool);
53  vtkGetMacro(Enabled, bool);
55 
59  virtual void RemoveAllLinks() = 0;
60 
67  const vtkSMMessage* GetFullState() override;
68 
76  void LoadState(const vtkSMMessage* msg, vtkSMProxyLocator* locator) override;
77 
81  virtual void UpdateState() = 0;
82 
86  virtual unsigned int GetNumberOfLinkedObjects() = 0;
87 
92  virtual int GetLinkedObjectDirection(int index) = 0;
93 
97  virtual vtkSMProxy* GetLinkedProxy(int index) = 0;
98 
99 protected:
100  vtkSMLink();
101  ~vtkSMLink() override;
102 
107  void PushStateToSession();
108 
113  virtual void UpdateVTKObjects(vtkSMProxy* proxy) = 0;
114 
120  virtual void PropertyModified(vtkSMProxy* proxy, const char* pname) = 0;
121 
127  virtual void UpdateProperty(vtkSMProxy* caller, const char* pname) = 0;
128 
132  void ObserveProxyUpdates(vtkSMProxy* proxy);
133 
137  virtual void SaveXMLState(const char* linkname, vtkPVXMLElement* parent) = 0;
138 
142  virtual int LoadXMLState(vtkPVXMLElement* linkElement, vtkSMProxyLocator* locator) = 0;
143 
144  friend class vtkSMLinkObserver;
145  friend class vtkSMStateLoader;
147 
149  // Set by default. In a link P1->P2, if this flag is set, when ever Proxy with P1
150  // is updated i.e. UpdateVTKObjects() is called, this class calls
151  // UpdateVTKObjects on Proxy with P2.
153 
154  bool Enabled;
155 
156  // Cached version of State
158 
159 private:
160  vtkSMLink(const vtkSMLink&) = delete;
161  void operator=(const vtkSMLink&) = delete;
162 };
163 
164 #endif
virtual void LoadState(const vtkSMMessage *msg, vtkSMProxyLocator *locator)
This method is used to initialise the object to the given state If the definitionOnly Flag is set to ...
#define VTKREMOTINGSERVERMANAGER_EXPORT
Header class that setup every thing in order to use Protobuf messages in a transparent manner...
const int NONE
The vtkSMSessionProxyManager is esponsible for creating and managing proxies for a given session...
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
virtual const vtkSMMessage * GetFullState()
This method return the full object state that can be used to create that object from scratch...
is used to locate proxies referred to in state xmls while loading state files.
Utility class to load state from XML.
baseclass for all proxy-objects that have counter parts on server as well as client processes...
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
void PrintSelf(ostream &os, vtkIndent indent) override