vtkSMProxyLink.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
14 #ifndef vtkSMProxyLink_h
15 #define vtkSMProxyLink_h
16 
17 #include "vtkRemotingServerManagerModule.h" //needed for exports
18 #include "vtkSMLink.h"
19 
20 #include <memory> // for unique_ptr
21 
22 struct vtkSMProxyLinkInternals;
23 
25 {
26 public:
27  static vtkSMProxyLink* New();
28  vtkTypeMacro(vtkSMProxyLink, vtkSMLink);
29  void PrintSelf(ostream& os, vtkIndent indent) override;
30 
32  {
33  BLACKLIST = 0,
34  WHITELIST
35  };
36 
44  virtual void AddLinkedProxy(vtkSMProxy* proxy, int updateDir);
45 
50  virtual void LinkProxies(vtkSMProxy* proxy1, vtkSMProxy* proxy2);
51 
55  virtual void LinkProxyPropertyProxies(vtkSMProxy* proxy1, vtkSMProxy* proxy2, const char* pname);
56 
60  virtual void RemoveLinkedProxy(vtkSMProxy* proxy);
61 
63 
66  unsigned int GetNumberOfLinkedObjects() override;
67  unsigned int GetNumberOfLinkedProxies();
69 
73  vtkSMProxy* GetLinkedProxy(int index) override;
74 
76 
80  int GetLinkedObjectDirection(int index) override;
81  int GetLinkedProxyDirection(int index);
83 
85 
94  void AddException(const char* propertyname);
95  void RemoveException(const char* propertyname);
96  void ClearExceptions();
98 
102  void RemoveAllLinks() override;
103 
111  void LoadState(const vtkSMMessage* msg, vtkSMProxyLocator* locator) override;
112 
114 
121  vtkSetMacro(ExceptionBehavior, int);
122  vtkGetMacro(ExceptionBehavior, int);
123  void SetExceptionBehaviorToBlacklist() { this->SetExceptionBehavior(BLACKLIST); }
124  void SetExceptionBehaviorToWhitelist() { this->SetExceptionBehavior(WHITELIST); }
126 
127 protected:
128  vtkSMProxyLink();
129  ~vtkSMProxyLink() override;
130 
135  void UpdateVTKObjects(vtkSMProxy* proxy) override;
136 
142  void PropertyModified(vtkSMProxy* proxy, const char* pname) override;
143 
149  void UpdateProperty(vtkSMProxy* caller, const char* pname) override;
150 
156  virtual std::string GetXMLTagName() { return "ProxyLink"; }
157 
161  void SaveXMLState(const char* linkname, vtkPVXMLElement* parent) override;
162 
166  int LoadXMLState(vtkPVXMLElement* linkElement, vtkSMProxyLocator* locator) override;
167 
171  void UpdateState() override;
172 
173 private:
174  vtkSMProxyLink(const vtkSMProxyLink&) = delete;
175  void operator=(const vtkSMProxyLink&) = delete;
176 
181  bool isPropertyLinked(const char* pname);
182 
183  std::unique_ptr<vtkSMProxyLinkInternals> Internals;
184  int ExceptionBehavior = BLACKLIST;
185 };
186 
187 #endif
#define VTKREMOTINGSERVERMANAGER_EXPORT
Header class that setup every thing in order to use Protobuf messages in a transparent manner...
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.
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
static vtkSMSessionObject * New()